Maven项目配置spring时 出现Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方案
来源:互联网 发布:mac安装tomcat 编辑:程序博客网 时间:2024/05/22 15:58
出现问题的原因
配置Maven项目,我把spring相关的xml都放到了resources下,但是spring默认会去web-inf下寻找xml,所以才会出现错误
Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
解决方法
在web.xml里指定spring相关xml的加载
正确的web.xml里spring加载设置<context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param><listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>springMvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
阅读全文
0 0
- Maven项目配置spring时 出现Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方案
- 解决Maven项目启动Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- 已经配置了context-param还是出现Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- dorado7 Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- 贪心算法之寻找最大数
- 树的遍历
- Windows程序设计 读书笔记(1)
- MySQL单机版安装
- 用java实现找出1-100之间的质数(两种方法)
- Maven项目配置spring时 出现Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方案
- 死锁与活锁的区别,死锁与饥饿的区别
- hibernate配置文件简介
- 关于jquery模仿select下拉选项
- hdu 5239 区间平方 线段树区间更新
- 【相克军】SQL语句解析类型_硬解析_软解析
- BZOJ1303 [CQOI2009]中位数图 【乱搞】
- Java中的Class类
- SDNU__1521.排序——堆排和快排