Spring中的ContextLoaderListener
来源:互联网 发布:vb九九乘法表代码tab 编辑:程序博客网 时间:2024/06/08 17:07
ContextLoaderListener的作用:
启动Web容器时,自动装配ApplicationContext的配置信息,因为它实现了ServletContextListener这个接口,在web.xml配置这个监听器,启动容器时,就会默认执行它实现的方法。
如何部署applicationContext的xml文件,如果在web.xml中不写任何参数配置信息,默认的路径是"/WEB-INF/applicationContext.xml,在WEB-INF目录下创建的xml文件的名称必须是applicationContext.xml。如果是要自定义文件名可以在web.xml里加入contextConfigLocation这个context参数:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContext-*.xml
</param-value>
</context-param>
在<param-value> </param-value>里指定相应的xml文件名,如果有多个xml文件,可以写在一起并一“,”号分隔。上面的applicationContext-*.xml采用通配符,比如这那个目录下有applicationContext-ibatis-base.xml,applicationContext-action.xml,applicationContext-ibatis-dao.xml等文件,都会一同被载入。
question:
在Java+Flex整合工程中,这些.xml文件为什么在Java源码src路径下也有一份?在Eclipse package explorer视图中的/WEB-INF/classes/为什么看不到,但是在workspace的文件夹/WEB-INF/classes/中却有这些文件?
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContext.xml,
/WEB-INF/classes/passContext.xml,
/WEB-INF/classes/oracleContext.xml,
/WEB-INF/classes/commonContext.xml,
/WEB-INF/classes/quartzContext.xml
</param-value>
</context-param>
参考:
http://wangpj.iteye.com/blog/882939
http://blog.csdn.net/ysughw/article/details/8992322
- Spring中的ContextLoaderListener
- Spring中的ContextLoaderListener作用
- Spring中的ContextLoaderListener作用
- Spring中的ContextLoaderListener
- Spring中的ContextLoaderListener作用
- Spring中的ContextLoaderListener作用
- Spring中的ContextLoaderListener作用
- Spring中的ContextLoaderListener使用
- SPRING中的CONTEXTLOADERLISTENER
- Spring中的ContextLoaderListener使用
- Spring中的ContextLoaderListener
- Spring中的ContextLoaderListener使用
- Spring中的ContextLoaderListener
- Spring中的ContextLoaderListener使用
- Spring中的ContextLoaderListener使用
- Spring中的ContextLoaderListener使用
- Spring中的ContextLoaderListener作用
- Spring中的ContextLoaderListener使用
- 安卓开发-进度条上方显示各个进度的视频片段,如何实现 安卓开发问题,请问这种进度条上弹框显示各个时间段视频片段是怎么实现的?![图片](http://img.ask.csdn.net/upload/2
- Java 中BufferedReader & InputStreamReader 用法
- jni文件内容解析
- 针对iOS的系统App后台运行的方法
- SSH框架的整合
- Spring中的ContextLoaderListener
- Android应用性能优化实践
- 证明 非 等价 不是联接词的完全集
- 学习Java的16个阶段
- GridView使用 与 BaseAdapter
- NSString字符串判断以某个str开头或者以某个str结尾
- AppDelegate 中的函数介绍
- 内存管理
- oc-字符串NSString,NSMutablesString基本使用方法