applicationContext.xml文件中怎么配置struts2和spring配置文件的加载路径
来源:互联网 发布:淘宝宝贝如何上下架 编辑:程序博客网 时间:2024/06/06 00:10
场景:要求项目的spring配置文件存在 src/springCfg 目录下,struts2的配置文件存放在 src/strutsCfg 目录下
为了实现该场景,在appltionContext.xml文件中的配置如下:
<!--Spring配置--> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:springCfg/spring-*.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- struts2配置 --> <filter> <filter-name>struts2</filter-name> <filter-class> support.struts2.filter.CustomStrutsPrepareAndExecuteFilter </filter-class> <init-param> <param-name>configPattern</param-name> <param-value>classpath*:strutsCfg/struts-*.xml</param-value> </init-param> <init-param> <param-name>configProviders</param-name> <param-value>support.struts2.config.providers.CustomConfigurationProvider</param-value> </init-param> </filter>
注意:通过该方式也可以只加载特定的某个文件作为配置文件
阅读全文
0 0
- applicationContext.xml文件中怎么配置struts2和spring配置文件的加载路径
- Spring配置文件详解 - applicationContext.xml文件路径
- Spring配置文件详解 - applicationContext.xml文件路径
- Spring配置文件详解 - applicationContext.xml文件路径
- Spring配置文件详解 - applicationContext.xml文件路径
- Spring配置文件详解 - applicationContext.xml文件路径
- Spring的配置文件ApplicationContext.xml配置头文件解析
- Spring 加载xml配置文件的方式 ApplicationContext
- Spring加载配置文件applicationContext.xml的方式
- Spring ApplicationContext配置文件的路径配置方式
- Spring加载applicationContext.xml的路径问题
- Spring中加载ApplicationContext.xml文件的方式
- Spring中加载ApplicationContext.xml文件的方式
- Spring中加载ApplicationContext.xml文件的方式【转】
- Spring中加载ApplicationContext.xml文件的方式
- Spring中加载ApplicationContext.xml文件的方式
- Spring中加载ApplicationContext.xml文件的方式
- Spring中加载ApplicationContext.xml文件的方式
- String的常用方法
- 根据配货员筛选订单
- TCP: SYN ACK FIN RST PSH URG 详解
- [538 Convert BST to Greater Tree]搜索二叉树的数值计算
- varchar2转换clob问题
- applicationContext.xml文件中怎么配置struts2和spring配置文件的加载路径
- jquery 实现抖动效果
- Filter案例(字符过滤器)
- SpringMVC拦截器(资源和权限管理)
- 关于几个统计用的C++方法
- 两张表弄懂Jsp中的四个作用域域和九个内置对象
- Java事务处理全解析(八)——分布式事务入门例子(Spring+JTA+Atomikos+Hibernate+JMS)
- 笔记:事件分发机制(二):ViewGroup的事件分发
- 注解定时任务实现