tomcat - JBoss - 可以在两个不同的上下文路径上发动 war 吗?

标签 tomcat jboss war

在 JBoss 中,是否可以在两个上下文路径上部署 Web 应用程序? 我希望在/和/path 上可用相同的 war 实例,因此,像“/abc”和“/path/abc”这样的请求都命中了网络应用程序的相同实例。

我试过了:

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

有什么建议吗?

最佳答案

由于 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?

关于tomcat - JBoss - 可以在两个不同的上下文路径上发动 war 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8808655/

相关文章:

tomcat - 在 tomcat 上部署的 war 文件给出 404 错误

java - 关于这个servlet+tomcat的例子,不能用javac编译servlet

login - JBoss Wildfly - 数据库登录模块

java - 如何使用eclipse IDE配置jboss应用服务器?

tomcat - 从 Grails 成功部署到 Tomcat 结果为 404 "resource not available"

ssl - tomcat 8.5 Centos 7 Nginx - 如何更改 War Web 应用程序的起始文件夹

eclipse - 如何在没有IDE的情况下在Tomcat上部署Restful

java - 为什么 JAX-WS 不需要 Web 容器

java - 在 windows server R2 enterprise 2008 中部署 java war 文件

tomcat - 使用 CXF 将 POJO 公开为 Web 服务,而无需部署为 WAR 文件