thrullcom

Deploying applications on root context on JBoss

I wanted to deploy application on default root "/" context on JBoss and I did not know how to do it :-). It really simple.

Simple Way: On JBoss (4.0.5 GA) there is an default root application deployed from ROOT.war located in

/servers/<server name>/deploy/jbossweb-tomcat55.sar/
- this is what we see in browser after default installation on http://localhost:8080/. To change root application we have to remove or rename the default ROOT.war directory and put our own ROOT.war in the deploy directory.



Elegant Way: More elegant way is to create jboss-web.xml file in WEB-INF/ directory of your web application with such content:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <context-root />
</jboss-web>

In both cases default ROOT.war should be removed or renamed for this configuration to work.

Information was found on JBoss Wiki.

This also works on Jetty and Tomcat