JBoss - 可以在两个不同的上下文路径上发起战争吗? [英] JBoss - possible to mount a war on two different context paths?

查看:17
本文介绍了JBoss - 可以在两个不同的上下文路径上发起战争吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

In JBoss, is it possible to deploy a web application on two context paths? I'd like same war instance available on / as well as /path , so, requests like '/abc' and '/path/abc' both hit same instance of the web app.

我试过:

<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.

but looks like it gets deployed only on /path. All requests to '/abc' are 404s.

有什么建议吗?

推荐答案

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

Since JBoss AS uses Tomcat as it's web container you can try to configure multiple context paths in context.xml.

有关进一步说明,请参阅这些链接:

See these links for further directions:

使用context.xml配置Tomcat应用上下文根

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

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

Tomcat context.xml 文件,有层次吗?

这篇关于JBoss - 可以在两个不同的上下文路径上发起战争吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆