Spring web.xml
来源:互联网 发布:神秘的程序员 头像 编辑:程序博客网 时间:2024/06/03 14:32
ContextLoaderListener是Spring项目中的web.xml中配置的监听器,
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
这个监听器的作用是什么呢?
第一是可以让我们在Class文件中直接引用Spring管理的bean,第二在容器启动的时候自动装配ApplicationContext配置信息
还有因为ContextLoaderListener可以看一下源码发现,他实际上是实现了ServletContextListener这个接口,在web容器启动的时候自动运行它所实现的方法,ServletContextListener中有两个方法
1、public void contextInitialized(ServletContextEvent sce);
2、public void contextDestroyed(ServletContextEvent sce);
ContextLoaderListener还继承了ContextLoader这个类,这个类关联WebApplicationContext, WebApplicationContext接口继承了ApplicationContext接口,所以整个加载过程由contextLoader完成。
阅读全文
0 0
- web.xml[spring][encoding]
- Spring mvc web.xml
- spring mvc web.xml
- spring web.xml
- spring中的web.xml
- spring web.xml
- spring-web.xml
- Spring web.xml
- web。xml初始化spring
- web.xml中配置spring
- web.xml方式加载Spring
- web.xml中配置Spring
- spring的web.xml配置
- spring web.xml中的配置
- web.xml配置spring监听器
- Spring的web.xml配置
- spring之web。xml学习
- spring 笔记之 web.xml
- eclipse不显示代码提示的解决方案
- HTTP缓存相关头
- 面试的知识总结和技巧
- GGH97
- Session机制、持久化、session="false"属性不创建session、显示创建session及其销毁
- Spring web.xml
- HDU1058
- 使用UI REST API采集Storm指标
- Storm 入门示例
- 统计字符串中各字符出现的次数
- AndroidStudio模拟器不好使的解决方法
- I
- ccf 数字排序
- git使用之上传项目文件到本地仓库