|
方法一:在初始化时保存ApplicationContext对象 代码: 方法二:通过Spring提供的工具类获取ApplicationContext对象
方法四:继承自抽象类WebApplicationObjectSupport 方法五:实现接口ApplicationContextAware 以上方法适合不同的情况,请根据具体情况选用相应的方法。
public class DicBean implements ServletContextAware{ private ServletContext servletContext; public void setServletContext(ServletContext sc) { |
详细解决方案
javaSpring获取Bean的几种模式
热度:224 发布时间:2012-10-13 11:38:17.0
相关解决方案
- 可否用很简单的文字介绍一上JAVA BEAN
- [求助]jsp+bean+servlet
- JAVA BEAN
- bean:write 属性的问题
- servlet与struts2共处,调用spring bean
- 异常:Cannot find bean under name org.apache.struts.taglib.html.BEAN
- Struts标签之Cannot find bean under name org.apache.struts.taglib.html.BEAN异常
- Weblogic下jar包被重复加载的有关问题:Bean type class com.opensymphony.xwork2.ObjectFactory with
- session bean 的了解
- JSP中怎么手动清除java bean
- jsonObject 转化 bean list 地图 array
- web起步加载servlet得到Spring bean
- JSON与JAVA的数据转换-Bean
- Spring中的<idref bean=""/><ref local=""/><idref local=""/><ref bean=""/>引见
- Bean 二 JSON USING XSTREAM
- servlet 中取得spring Bean 的方法
- json字符串转换成List<bean>
- script 调用 bean,该如何解决
- 关于spring bean 注入的一个有关问题
- spring bean 生命周期 有何用解决方法
- javabean有关问题:Cannot find any information on property 'TheName' in a bean of type '
- Spring注解出错:Error creating bean with name
- struts2 该如何保存set<Bean>类型
- 对List<Bean>模式的数据进行转换,对元素相同的属性进行归并处理,生成Map<K,V>格式
- <c:foreach>取List<bean>的值,求指教。解决办法
- Cannot retrieve definition for form bean null on action /savePlanB解决方案
- struts1.2.x <bean:write>标签有关问题
- struts 1.2 bean:write的有关问题
- 关于 Bean 的有关问题,很着急请帮帮小弟我
- jsp servlet bean 编写好后运行出现这种异常,请大家帮帮忙~