关于URLWriter的用法
参见:http://www.tuckey.org/urlrewrite/
1
<dependency>
<groupId>org.tuckey</groupId>
<artifactId>urlrewritefilter</artifactId>
<version>4.0.3</version>
</dependency>
2
To WEB-INF/web.xml add (near the top above any servlet mappings): (see filter parameters for more options)
<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>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
3
Add urlrewrite.xml in WEB-INF (src/main/webapp/WEB-INF/ for Maven users)
After restarting you can visit http://127.0.0.1:8080/rewrite-status (or whatever the address of your local webapp and context) to see output (note: this page is only viewable from localhost).
After restarting you can visit http://127.0.0.1:8080/rewrite-status (or whatever the address of your local webapp and context) to see output (note: this page is only viewable from localhost).
posted on 2013-10-31 17:04 ONLY LOVE PROGRAME 阅读(670) 评论(0) 收藏 举报
浙公网安备 33010602011771号