JBoss - possible to mount a war on two different c

2019-02-28 02:38发布

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.

I tried :

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

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

Any suggestions?

标签: tomcat jboss war
1条回答
兄弟一词,经得起流年.
2楼-- · 2019-02-28 03:07

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:

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?

查看更多
登录 后发表回答