1、概述 ?2、BeanFactory ? ?3、ApplicationContext 4、Bean管理 5、创建Bean
分类:
编程语言 时间:
2015-06-15 11:29:02
阅读次数:
159
定义一个filter, 实现ApplicationContextAware接口:public class CacheFilter implements Filter, ApplicationContextAware {
private static ApplicationContext ctx; // 必须声明为static @Override
public void init...
分类:
编程语言 时间:
2015-06-15 00:21:50
阅读次数:
147
1、applicationContext.xml ...
分类:
编程语言 时间:
2015-06-15 00:05:16
阅读次数:
138
用maven编译,tomcat启动时报错:IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is com.sun.org.apache.xerces...
分类:
其他好文 时间:
2015-06-15 00:02:40
阅读次数:
152
现象:spring加载配置文件applicationContext.xml出错,抛出nested exception is og.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 47; cvc-elt.1: 找不到元素 'beans'...
分类:
编程语言 时间:
2015-06-13 21:26:42
阅读次数:
730
欢迎大家向我推荐你在面试过程中遇到关于Spring的问题。我会把大家推荐的问题添加到下面的Spring常用面试题清单中供大家参考。
问题清单:
什么是Spring框架?Spring框架有哪些主要模块?使用Spring框架有什么好处?什么是控制反转(IOC)?什么是依赖注入?请解释下Spring中的IOC?BeanFactory和ApplicationContext有什么区别?将Spri...
分类:
编程语言 时间:
2015-06-12 13:25:16
阅读次数:
143
方法一:在初始化时保存ApplicationContext对象
方法二:通过Spring提供的utils类获取ApplicationContext对象
方法三:继承自抽象类ApplicationObjectSupport
方法四:继承自抽象类WebApplicationObjectSupport
方法五:实现接口ApplicationContextAware
方法六:通过Spr...
分类:
编程语言 时间:
2015-06-12 11:50:36
阅读次数:
137
使用注解来构造IoC容器用注解来向Spring容器注册Bean。需要在applicationContext.xml中注册。如:在base-package指明一个包1 表明cn.gacl.java包及其子包中,如果某个类的头上带有特定的注解【@Component/@Repository/@Servic...
分类:
编程语言 时间:
2015-06-11 21:03:40
阅读次数:
110
Spring是从一个实际开发中抽取出来的框架,因此它完成了大量开发中通用步骤,留给开发者的仅仅是与特定应用相关的部分,从而大大提高开发效率。Spring 有两个核心接口:BeanFactory和ApplicationContext,其中ApplicationContext是BeanFactor...
分类:
编程语言 时间:
2015-06-11 14:23:25
阅读次数:
143
Android中context可以作很多操作,但是最主要的功能是加载和访问资源。在android中有两种context,一种是application context,一种是activity context,通常我们在各种类和方法间传递的是activity context。区别联系:public cl...
分类:
移动开发 时间:
2015-06-10 17:16:53
阅读次数:
105