当前位置: 代码迷 >> Java Web开发 >> struts2配置提示404,web配置中去掉过滤器就正常了,
  详细解决方案

struts2配置提示404,web配置中去掉过滤器就正常了,

热度:339   发布时间:2012-02-06 16:47:28.0
struts2配置提示404,web配置中去掉过滤器就正常了,
struts:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
    <package name="itcast" namespace="/test" extends="struts-default">
        <action name="helloworld" class="cn.itcast.action.HelloWorld" method="execute">
            <result name="success">/WEB-INF/page/hello.jsp</result>
        </action>
    </package>
</struts>

web:
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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.ng.filter.StrutsPrepareAndExecuteFilter</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>
小弟初学这个,还望兄弟了多多指教
搜索更多相关主题的帖子: class  过滤器  Software  version  package  

----------------解决方案--------------------------------------------------------
  相关解决方案