问题描述
严重:ExceptionstartingfilterStruts2.0java.lang.ClassNotFoundException:org.apache.Struts2.0.dispatcher.FilterDispatcher去掉web.xml中的file的内容就不会出现上面的错误,web.xml中应该怎么写啊<?xmlversion="1.0"encoding="UTF-8"?><web-app><display-name>Struts2.0.0</display-name><filter><filter-name>Struts2.0</filter-name><filter-class>org.apache.Struts2.0.dispatcher.FilterDispatcher</filter-class><init-param><param-name>config</param-name><param-value>struts-default.xml,struts-plugin.xml,struts.xml</param-value></init-param></filter><filter-mapping><filter-name>Struts2.0</filter-name><url-pattern>/*</url-pattern></filter-mapping></web-app>
解决方案
解决方案二:
filter配置错了,没有这个过滤器类,好像是org.apache.struts.dispatcher.FilterDispatcher
解决方案三:
<?xmlversion="1.0"encoding="UTF-8"?><web-appid="WebApp_ID"version="2.4"xmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"><welcome-file-list><welcome-file>index.html</welcome-file><welcome-file>index.htm</welcome-file><welcome-file>index.jsp</welcome-file><welcome-file>default.html</welcome-file><welcome-file>default.htm</welcome-file><welcome-file>default.jsp</welcome-file></welcome-file-list><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener><filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern></filter-mapping><jsp-config><taglib><taglib-uri>/WEB-INF/page.tld</taglib-uri><taglib-location>/WEB-INF/page.tld</taglib-location></taglib></jsp-config></web-app>
解决方案四:
<?xmlversion="1.0"encoding="UTF-8"?><web-appid="WebApp_ID"version="2.4"xmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"><filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern></filter-mapping><security-constraint><web-resource-collection><web-resource-name>JSPs</web-resource-name><url-pattern>/jsp/*</url-pattern><auth-constraint></web-resource-collection></security-constraint></web-app>
解决方案五:
<filter-class>org.apache.Struts2.dispatcher.FilterDispatcher</filter-class>