UrlRewriteFilter官方配置教程(jsp转html)

来源:互联网 发布:麦子学院php百度云 编辑:程序博客网 时间:2024/04/28 22:42

Install

1

Add urlrewritefilter-4.0.3.jar 
to WEB-INF/lib 

Or add Maven dependency
<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).

0 0
原创粉丝点击