[Java教程]Spring配置文件
0
2016-03-19 00:00:08
Spring配置文件是集成了Spring框架的项目的核心,引擎从哪里开始,中间都执行了哪些操作,小谈一下它的执行流程。
容器先是加载web.
接着是applicationContext.
一种方法是加入ContextLoaderServlet这个servletcontextConfigLocation/WEB-INF/applicationContext.context org.springframework.web.context.ContextLoaderServlet 0
还有一种是添加ContextLoaderListener这个监听器contextConfigLocation/WEB-INF/applicationContext.org.springframework.web.context.ContextLoaderListener
ContextLoaderServlet和ContextLoaderListener都是先创建ContextLoader的一个对象,然后调用它的initWebApplicationContex方法初始化WebApplicationContext获得一个对象;
spring加载多个配置文件,在web.contextConfigLocationclasspath*:spring/*.SpringContextServlet org.springframework.web.context.ContextLoaderServlet 3
文章出自:http://www.cnblogs.com/mabaishui/archive/2010/07/14/1777233.html
本文网址:http://www.shaoqun.com/a/202912.html
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:admin@shaoqun.com。
Spring
0