struts2框架web.xml
<?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">
<display-name>
struts_helloworld</display-name>


<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>
<welcome-file-list> <welcome-file>index.jsp</welcome-file>

</welcome-file-list>
</web-app>lib文件1.commons-io-1.1.jar,
2.commons-logging-1.0.2.jar,
3.freeer-2.3.13.jar,
4.ognl-2.6.11.jar,
5.struts2-core-2.1.6.jar,
6.xwork-2.1.2.jar,commons-fileupload-1.1.1.jar
和一个index.jsp页面,struts.xml文件没有配置

解决方案 »

  1.   

    HTTP Status 404 - --------------------------------------------------------------------------------type Status reportmessage description The requested resource () is not available.
    --------------------------------------------------------------------------------Apache Tomcat/6.0.18
      

  2.   

    一般都是tomcat有报错,context没起来。先查日志。
      

  3.   

    严重: Error filterStart
    2009-8-6 18:17:18 org.apache.catalina.core.StandardContext start
    严重: Context [/struts_helloworld] startup failed due to previous errors
    2009-8-6 18:17:18 org.apache.coyote.http11.Http11Protocol start
    2009-8-6 18:17:18 com.opensymphony.xwork2.util.logging.commons.CommonsLogger fatal
    严重: Premature end of file. at (null:2:1)
    2009-8-6 18:17:18 org.apache.catalina.core.StandardContext filterStart
    严重: Exception starting filter struts2
      

  4.   

    看不出来,这是我导的struts的jar
    commons-fileupload-1.0.jar 
    antlr.jar 
    commons-beanutils.jar 
    commons-digester.jar 
    commons-logging.jar 
    commons-validator.jar 
    jakarta-oro.jar 
    struts.jar 
     
      

  5.   

    在使用struts2的时候不要把包全加上..
      

  6.   


    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher </filter-class>
    你的过滤器是在这个包名org.apache.struts2.dispatcher下?
    类名是FilterDispatcher 吗?
      

  7.   

    是不是把所有的给贴出来看看呀?jar包看着没少加呀
      

  8.   

    <filter>
    <filter-name>UrlRewriteFilter</filter-name>
    <filter-class>
    org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
    </filter-class>
    <init-param>
    <param-name>logLevel</param-name>
    <param-value>WARN</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>UrlRewriteFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    </filter-mapping>