【发布时间】:2010-12-06 12:49:43
【问题描述】:
我将构建一个 Web 应用程序,并且我想使用 url 重写。 在 apache 中,这是通过 mod_rewrite 完成的。 但是如何使用 Tomcat 6 重写 url?
我想使用 Struts 2 框架。
【问题讨论】:
标签: apache tomcat servlets struts2
我将构建一个 Web 应用程序,并且我想使用 url 重写。 在 apache 中,这是通过 mod_rewrite 完成的。 但是如何使用 Tomcat 6 重写 url?
我想使用 Struts 2 框架。
【问题讨论】:
标签: apache tomcat servlets struts2
我已将UrlRewriteFilter 用作我的几个基于 tomcat 的应用程序的关键组件,并且对此非常满意。
【讨论】:
你可以在你的 struts.xml 中做wildcard mappings:
<action name="*Crud" class="example.Crud" method="{1}">
...
那我想你可以在struts.properties中将默认操作扩展设置为/:
struts.action.extension=/
关于 URL 过滤器,here's a good blog post。
【讨论】:
could be 让 Apache 作为 Tomcat 应用程序服务器前面的静态内容的 Web 服务器是个好主意。
然后您可以使用Apache's mod_rewrite and Tomcat。
无论如何,有a similar question。
【讨论】: