servlet3的url重写问题

我以前是servlet2,重写没得问题,但是我转成3的时候发现重写失效了下面的配置文件
web.xml

<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">


UrlRewriterFilter
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter


UrlRewriterFilter
/*
REQUEST
FORWARD


index.html
index.jsp
index

urlrewrite.xml
<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 2.6//EN"

"http://tuckey.org/res/dtds/urlrewrite2.6.dtd">

<rule>
    <from>/([a-zA-Z_0-9]+)/([0-9]+).html</from>
    <to>/recept?action=$1&amp;menuId=$2</to>
</rule>

<rule>
    <from>/([a-zA-Z_0-9]+)/([0-9]+)_([0-9]+).html</from>
    <to>/recept?action=$1&amp;menuId=$2&amp;page=$3</to>
</rule>

<rule>
    <from>/siteMap.xml</from>
    <to>/siteMap</to>
</rule>

查看全部
zfting
zfting
2016/03/31 08:35
  • servlet
  • 点赞
  • 收藏
  • 回答
    私信

1个回复