5.3. Setting the Default Server Application
JBoss Enterprise Application Platform, by default, configures
<JBOSS_HOME>/jboss-as/server/<PROFILE>/deploy/ROOT.war
as the default application on the server. So accessing http://localhost:8080/
results in displaying the index page of this application. If you want your application to be available as the default application, then you will wish to follow these steps:
- Rename
ROOT.war
in<JBOSS_HOME>/jboss-as/server/<PROFILE>/deploy
to something else, for example,jboss.war
. - In your WAR file (the one which you want to be the default application), add a
jboss-web.xml
, in theWEB-INF
folder, with a configuration for the context-root:<?xml version="1.0"?> <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd"> <jboss-web> <context-root>/</context-root> <!-- Other configurations as needed --> </jboss-web>
By setting the context-root to/
you are making your application the default application. Your application will now be available athttp://localhost:8080/
.Note
Renaming theROOT.war
tojboss.war
will make that application be available athttp://localhost:8080/jboss