xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 
xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>reportingsystem</display-name>
  <welcome-file-list>
    <welcome-file>/admin/login.jsp</welcome-file>
  </welcome-file-list>
  
<!-- 字符过滤器 -->
  <filter>
  <filter-name>struts-cleanup</filter-name>
  <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
  </filter>
  <filter-mapping> 
<filter-name>struts-cleanup</filter-name> 
<url-pattern>/*</url-pattern> 
</filter-mapping> 
  
  
  
  <!-- UrlRewriteFilter简化URL,有利于搜索引擎收录 -->
<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>
</filter-mapping> <!-- Struts2 核心过滤器 --><!-- 
    <filter>  
        <filter-name>struts2-cleanup</filter-name>  
        <filter-class>  
            org.apache.struts2.dispatcher.ActionContextCleanUp   
        </filter-class>  
    </filter>  
  --><filter>
   <filter-name>struts2</filter-name>
   <filter-class>
   org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
   </filter-class>
<!--<init-param>  
  <param-name>config</param-name>  
  <param-value>struts-default.xml,struts-plugin.xml,struts.xml,struts-user.xml </param-value>  
</init-param> 
  
  -->
  </filter>
  <filter>
   <filter-name>userlogin</filter-name>
   <filter-class>
   com.web.filter.UrlFilter
   </filter-class>
   </filter>
   <filter-mapping>
     <filter-name>userlogin</filter-name>
     <url-pattern>/admin/system/*</url-pattern>
   </filter-mapping>
   <!--
    <filter-mapping> 
<filter-name>struts2</filter-name> 
<url-pattern>*.jsp</url-pattern> 
</filter-mapping> 

--><!--<filter-mapping>  
        <filter-name>struts2-cleanup</filter-name>  
        <url-pattern>/*</url-pattern>  
        <dispatcher>REQUEST</dispatcher>     
        <dispatcher>FORWARD</dispatcher>
         <dispatcher>INCLUDE </dispatcher>    
    </filter-mapping>  

-->
<filter-mapping> 
<filter-name>struts2</filter-name>  
       <url-pattern>/*</url-pattern>  
       <dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>  
     </filter-mapping> 
  
  <!-- spring的应用上下文 -->
<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/applicationContext*.xml,/WEB-INF/daoContext.xml</param-value>
</context-param>
  <!-- spring的监听器,以便在启动时就自动加载spring的配置 -->
<listener>
  <listener-class>
   org.springframework.web.context.ContextLoaderListener
  </listener-class>
</listener><!-- OpenSessionInViewFilter过滤器 -->
<filter>
  <filter-name>lazyLoadingFilter</filter-name>
  <filter-class>
   org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
  </filter-class>
</filter>
<filter-mapping>
  <filter-name>lazyLoadingFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>
  </web-app>  
  urlrewrite.xml<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 2.6//EN"
  "http://tuckey.org/res/dtds/urlrewrite2.6.dtd"><urlrewrite>   
<rule>
<from>web</from>
<to type="forward"  >web/index.action</to>
</rule>   
</urlrewrite>
主要是完成http://localhost:7001/reportingsystem/web/index.action
变成http://localhost:7001/reportingsystem/web
以上配置可以直接过去,但是到了页面点链接跳转其他页面就出404错误There is no Action mapped for namespace /web/index.action and action name index无法定义到namespace   这页面中的方法都是定义在namespace="/web"下的