【问题标题】:JBoss - possible to mount a war on two different context paths?JBoss - 可以在两个不同的上下文路径上发起战争吗?
【发布时间】:2012-01-11 15:02:25
【问题描述】:

在 JBoss 中,是否可以在两个上下文路径上部署 Web 应用程序? 我希望 / 和 /path 上都可以使用相同的战争实例,因此,像 '/abc' 和 '/path/abc' 这样的请求都会命中 Web 应用程序的同一个实例。

我试过了:

<module>
    <web>
        <web-uri>web-app.war</web-uri>
        <context-root>/</context-root>
    </web>
</module>

<module>
    <web>
        <web-uri>web-app.war</web-uri>
        <context-root>/path</context-root>
    </web>
</module>

但看起来它只部署在 /path 上。对“/abc”的所有请求都是 404。

有什么建议吗?

【问题讨论】:

  • 用URL rewriting使用Apache前端Web服务器不是更方便吗?

标签: tomcat jboss war


【解决方案1】:

由于 JBoss AS 使用 Tomcat 作为其 Web 容器,您可以尝试在 context.xml 中配置多个上下文路径。

查看这些链接了解更多说明:

Configure Tomcat application context root with context.xml

http://community.jboss.org/wiki/Web-AppContextConfiguration

http://docs.jboss.org/jbossweb/2.1.x/config/context.html

Tomcat context.xml files, is there a hiearchy?

【讨论】:

    猜你喜欢
    • 2015-07-02
    • 1970-01-01
    • 2015-06-19
    • 1970-01-01
    • 1970-01-01
    • 2013-07-20
    • 2014-06-25
    • 2011-01-04
    • 2015-09-01
    相关资源
    最近更新 更多