标题:struts2配置提示404,web配置中去掉过滤器就正常了,
取消只看楼主
chenhao19860
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:86
专家分:151
注 册:2010-3-15
结帖率:66.67%
 问题点数:0 回复次数: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.

<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.
    xmlns:xsi="http://www.
    xsi:schemaLocation="http://java.
    http://java.

  <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 
2012-02-06 16:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-360486-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015150 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved