如题,我使用MyEclipse在整合Struts2和Spring的时候,applicationContext.xml文件放在了/WebRoot/WEB-INF/下,可是在web.xml中配置好了后,启动Tomcat总是出现异常,说找不到applicationContext.xml,请问这个文件应该放在哪里?
这样配置对么?
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WebRoot/WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<filter>
<filter-name>Struts2Filter</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>Struts2Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
按照rihongedu所说的,可我的还是不行啊,好奇怪,能不能给我发下例子呢?谢谢了
我EMail:cuiyuesw@sina.com