![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
Jane_s
这个作者很懒,什么都没留下…
展开
-
Spring中ApplicationContext加载机制
加载器目前有两种选择:ContextLoaderListener和ContextLoaderServlet。 这两者在功能上完全等同,只是一个是基于Servlet2.3版本中新引入的Listener接口实现,而另一个基于Servlet接口实现。开发中可根据目标Web容器的实际情况进行选择。ContextLoaderListener配置非常简单,在web.xml中增加:翻译 2013-12-20 10:57:02 · 357 阅读 · 0 评论 -
spring 中applicationContext的三种实现方式
ApplicationContext的三种实现为:1.ClassPathXmlApplicationContext这种方式是通过类路径的方式来加载spring配置文件来进行实例化的。例如:BeanFactory beanFactory = new ClassPathXmlApplicationContext("chapter2/namingbean1.xml");或 Ap翻译 2013-12-20 10:54:00 · 1303 阅读 · 0 评论