Thursday, March 3, 2011

How to Set Context Path of Java EE/Web Application in JBoss App Server

If your web application is packaged as a WAR file then you can create jboss-web.xml under WEB-INF folder of WAR file and specify the context-root in jboss-web.xml like this :

<jboss-web>   <context-root>MyWebAppContext</context-root> </jboss-web>

If your application is packaged as an EAR file then you can specify context-root in META-INF/application.xml of EAR like this

<module>     <web>       <web-uri>MyWAR.war</web-uri>       <context-root>MyWebAppContext</context-root>     </web>   </module>
Source: http://stackoverflow.com/questions/2046604/context-path-in-jboss