urlrewrite伪静态

urlrewrite最简单的使用:

 

1,导入包urlrewrite-3.1.0.jar

2,创建urlrewrite.xml


 

<urlrewrite>
        <rule>
         <note/>
         <from>yzm.url</from>
         <to type="forward">/yzm.action</to>
       </rule>
</urlrewrite>


 

3,修改web.xml

<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>


 

 

并在每一个<url-pattern>/*</url-pattern>下加

<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>


 

 


页面调用yzm.url

你可能感兴趣的:(伪静态,urlrewrite,路径重写)