web.xml配置spring监听器
来源:互联网 发布:天津报税软件下载 编辑:程序博客网 时间:2024/05/05 13:21
1、可以参考struts的docs文档spring-plugin.html。
2、也可以参考spring的帮助文档的15.4节struts。
- Configure the Spring listener
web.xml
<listener><listenerclass>org.springframework.web.context.ContextLoaderListener</listener-class></listener> <context-param><param-name>contextConfigLocation</param-name><!--<param-value>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml</param-value>--> <param-value>classpath:beans.xml</param-value></context-param>
默认的路径是>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml,也可以把spring的配置文件放到src目录下,配置就是classpath:beans.xml。其中beans.xml是文件名。
原帮助文档的描述:
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans default-autowire="autodetect"> <bean id="personManager" class="com.acme.PersonManager"/> ...</beans>
Since the Spring integration uses a standard Listener, it can be configured to support configuration files other than applicationContext.xml. Adding the following to your web.xml will cause Spring's ApplicationContext to be inititalized from all files matching the given pattern:
<!-- Context Configuration locations for Spring XML files -->
<context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml</param-value> </context-param>
See the Spring documentation for a full description of this parameter.
注意:
如果beans.xml文件放在src目录下,在生成ApplicationContext ctx=new ClassPathXmlApplicationC
- web.xml配置spring监听器
- [Spring]web.xml中配置ContextLoaderListener监听器的作用
- [Spring]web.xml中配置ContextLoaderListener监听器的作用
- spring security web.xml 监听器
- web.xml Listener 监听器配置
- web.xml过滤器和监听器的配置
- web.xml配置详解之监听器,过滤器
- springmvc 和 spring 整合的 web.xml 配置(包括监听器,乱码解决等)
- Tomcat8.x web.xml监听器的配置的解析->监听器的实例化->监听器的调用
- spring项目中,web.xml中的 ContextLoaderListener监听器的原理
- 通过web.xml中的监听器加载spring配置文件
- ssh整合web.xml过滤器和监听器的配置
- web.xml里面配置监听器后 tomcat无法重启
- ssh整合web.xml过滤器和监听器的配置(转载)
- 部署描述文件web.xml解析(六) 配置应用程序监听器
- “servlet监听器”以及在web.xml中的配置
- web.xml中配置spring
- web.xml中配置Spring
- SVN主干/分支开发模式分享
- unity3d GameCenter
- 【独家对话】卫星导航与移动GIS----北斗导航应用分会主席曹冲专访
- 吐槽cocos2d-x内存管理缺陷
- IOS Info.plist
- web.xml配置spring监听器
- Nuance推安卓版语音助手 休眠时也可语音唤醒
- openssl使用手册
- ios 网络电话开发 (Voip Client For iPhone )
- c++中const类型的使用与注意事项
- unity3d 摄像机切换脚本
- MOSS如何创建一个可以匿名发帖的留言板
- Testing Davison's MonoSLAM
- jQueryUI之autocomplete,datepicker,tabs演示