1/导入包urlrewrite-3.1.0.jar
2/创建urlrewrite.xml
1 <urlrewrite> 2 <rule> 3 <note/> 4 <from>yzm.url</from> 5 <to type="forward">/yzm.action</to> 6 </rule> 7 </urlrewrite>
3/修改web.xml 放在session之下struts之上
1 <filter> 2 <filter-name>UrlrewriteFilter</filter-name> 3 <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> 4 </filter> 5 <filter-mapping> 6 <filter-name>UrlrewriteFilter</filter-name> 7 <url-pattern>/*</url-pattern> 8 </filter-mapping>
并在<url-pattern>/*</url-pattern>下加 :
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
页面调用yzm.url
over!!!