web.xml 中加入
<!-- url重写-->
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
注意在
<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>
[color=red] [b]<!-- 重新必须加的 -->
<dispatcher>FORWARD</dispatcher>[/b][/color]
</filter-mapping>
中加入 红色划线部分
url重写的filter 要加在struts2 的filter 上面
<!-- url重写-->
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
注意在
<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>
[color=red] [b]<!-- 重新必须加的 -->
<dispatcher>FORWARD</dispatcher>[/b][/color]
</filter-mapping>
中加入 红色划线部分
url重写的filter 要加在struts2 的filter 上面