带Glassfish的UrlRewriteFilter [英] UrlRewriteFilter with Glassfish
问题描述
如何在我的Glassfish v3服务器中集成URL重写?
我想知道这个的原因是我将一个PHP应用程序部署到我的Glassfish服务器使用Quercus。
但是Quercus依靠Apache服务器中的 mod_rewrite
来提供URL重写,而这在Glassfish。
好吧,您有两个选择:
我想前者不是一个选项(或者你不会发布这个问题)。关于后面的内容,你可以修改使用Url重写过滤器的干净网址上的Drupal on Glassfish 。基本上,你必须:
- 获得Quercus的战争并解开它
- 下载过滤器并将其解压缩到Quercus中(这会将过滤器jar放入
WEB-INF / lib
以及WEB-INF
下的urlrewrite.xml
li>
- 在
web.xml
中声明过滤器(请参阅说明)
- Port将规则重写到
urlrewrite.xml
文件 - 重新打包并部署战争(或将其部署为展开式存档)
How can I integrate URL rewriting in my Glassfish v3 server?
The reason why I want to know this is that I am deploying a PHP application into my Glassfish server using Quercus.
But Quercus relies on mod_rewrite
in the Apache Server to provide URL rewriting and this is not available in Glassfish.
Well, you have two options:
- either front your GlassFish instance with Apache and use mod_rewrite
- or use Tuckey's Url Rewrite Filter
I guess the former is not an option (or you wouldn't post this question). Regarding the later, you could adapt the solution given in Drupal on Glassfish with clean urls using Url Rewrite Filter. Basically, you'll have to:
- Get Quercus's war and unpack it
- Download the filter and unpack it inside Quercus (this will put the filter jar inside
WEB-INF/lib
and theurlrewrite.xml
underWEB-INF
) - Declare the filter in the
web.xml
(see the instruction) - "Port" your rewrite rules to the
urlrewrite.xml
file - repackage and deploy the war (or deploy it as an exploded archive)
这篇关于带Glassfish的UrlRewriteFilter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!