Friday, June 5, 2009

Context root of single war's web applicaton in JBoss

Context root of web application is usually specifiedin META-INF/application.xml in ear file (or a vendor specific jboss-web.xml inside war ) e.g.
...
  <module>
    <web>
      <web-uri>app.war</web-uri>
      <context-root>/jsfejb3<context-root>
    </web>
  </module>
..
However if we drop a single war file without vendor specific descriptor (jboss-web.xml) into JBoss deploy directory then context root is implicitly the name of the war file without extension.
e.g.
Web application jmx-console residing in default/deploy/jmx-console.war has context root jmx-console
Web application groovy-scripts residing in default/deploy/groovy-script.war has context root groovy-script and can be accessible via http://localhost:7080/groovy-script