您的位置:程序门 -> java -> j2ee / ejb / jms



spring的webapplicationcontextutils


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


spring的webapplicationcontextutils
发表于:2007-05-17 18:52:19 楼主
public   object   getbean(string   name)      
    {      
applicationcontext   ctx   =   null;
            if   (ctx   ==   null)      
            {      
                    ctx   =   webapplicationcontextutils.getrequiredwebapplicationcontext(servlet.getservletcontext());      
            }      
            return   ctx.getbean(name);      
    }
我把它放在javabean里面说“servlet无法解析”,,还是只能在servlet里,因为我想通过spring   获得bean,网上找到这个代码,但出错了


快速检索

最新资讯
热门点击