报错:严重: Servlet /11.01 threw load() exception
javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts-config.xml
我已经配置了struts-config.xml在web-inf下了,为什么还说找不到,求大神指教
javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts-config.xml
我已经配置了struts-config.xml在web-inf下了,为什么还说找不到,求大神指教
或者你把工程的路径结构和web.xml贴上来,大家看看。
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>InsertUserinfp</servlet-name>
<servlet-class>com.action.InsertUserinfp</servlet-class>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>insertUserInfp</servlet-name>
<servlet-class>com.action.insertUserInfp</servlet-class>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>InsertUserInfp</servlet-name>
<servlet-class>com.action.InsertUserInfp</servlet-class>
</servlet> <servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>InsertUserinfp</servlet-name>
<url-pattern>/InsertUserinfp</url-pattern>
</servlet-mapping> <servlet-mapping>
<servlet-name>InsertUserInfp</servlet-name>
<url-pattern>/InsertUserInfp</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
你看下,谢了哈
我有两种方法:
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
或者
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>filterConfig</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
</filter>