【发布时间】:2012-03-22 18:16:56
【问题描述】:
我在我的 java 项目上使用 org.tukey.web.filters.urlrewrite.UrlRewriteFilter。它工作正常。我的问题是它改变了现有的 url。
示例我需要将 mainurl/news/cricket 重定向到 mainurl/news.jsp/id=2
myurlrewriter.xml
<rule>
<note>
The rule means that requests to /test/status/ will be redirected to /rewrite-status
the url will be rewritten.
</note>
<from>/news/cricket</from>
<to type="redirect">%{context-path}/news.jsp/id=2</to>
</rule>
它将整个 url 重定向到 news.jsp/id=2 但我不想更改 url,只更改内容,可以吗?任何人都知道怎么做。
非常感谢您的帮助。
谢谢, VKS。
【问题讨论】:
标签: java tomcat url-rewriting