严重: Exception starting filter Struts 2.0
java.lang.ClassNotFoundException: org.apache.Struts 2.0.dispatcher.FilterDispatcher
去掉web.xml中的file的内容 就不会出现上面的错误,web.xml中应该怎么写啊<?xml version="1.0" encoding="UTF-8"?>
<web-app>
    <display-name>Struts 2.0.0</display-name>    <filter>
        <filter-name>Struts 2.0</filter-name>
        <filter-class>org.apache.Struts 2.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>Struts 2.0</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
        </web-app>

解决方案 »

  1.   

    filter配置错了,没有这个过滤器类,好像是org.apache.struts.dispatcher.FilterDispatcher
      

  2.   

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="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/j2ee http://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>
      

  3.   

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="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/j2ee http://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>
      

  4.   

    <filter-class>org.apache.Struts2.dispatcher.FilterDispatcher</filter-class>