title: context-root for sub context
body: <p>I have multiple war files in my ear. Each war file corresponds to a particular version. This is packaged structure:</p>
  
  <pre><code>TestServiceEAR
            ServiceOneWAR  --&gt;  http://host:port/test/1.0
            ServiceTwoWAR  --&gt;  http://host:port//test/2.0.
  </code></pre>
  
  <p>I want to target ServiceOneWAR as <a href="http://host:port/test/1.0" rel="nofollow">http://host:port/test/1.0</a> and ServiceTwoWAR as <a href="http://host:port/test/2.0" rel="nofollow">http://host:port/test/2.0</a>. I tried to set the context-roots in TestServiceEAR/EARContent/META-INF/application.xml as /test/1.0 and /test/2.0, but that does not work. </p>
  
  <p>Please suggest if this can be achieved in Websphere application server. I do not have access to a web server in my organization.</p>
  
  <p>The application.xml is:</p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6"&gt;
        &lt;display-name&gt;TestServiceEAR&lt;/display-name&gt;
        &lt;module&gt;
          &lt;web&gt;
            &lt;web-uri&gt;TestService_v1.war&lt;/web-uri&gt;
            &lt;context-root&gt;/test/1.0&lt;/context-root&gt;
          &lt;/web&gt;
        &lt;/module&gt;
        &lt;module id="Module_1431504891524"&gt;
          &lt;web&gt;
            &lt;web-uri&gt;TestService_v2.war&lt;/web-uri&gt;
            &lt;context-root&gt;/test/2.0&lt;/context-root&gt;
          &lt;/web&gt;
        &lt;/module&gt;
        &lt;library-directory&gt;lib&lt;/library-directory&gt;
      &lt;/application&gt;
  </code></pre>
  
  <p>Got this resolved. The issue was that I was updating the context in application.xml and it was reset to the previous value in pom.xml. After updating pom.xml the issue was resolved.</p>
  
  <pre><code>&lt;webModule&gt;
      &lt;groupId&gt;${war.groupId}&lt;/groupId&gt;
      &lt;artifactId&gt;${war.artifactId}&lt;/artifactId&gt;
      &lt;uri&gt;${war.artifactId}.war&lt;/uri&gt;
      &lt;bundleFileName&gt;${war.artifactId}.war&lt;/bundleFileName&gt;
      &lt;contextRoot&gt;/test/1.0&lt;/contextRoot&gt;
  &lt;/webModule&gt;
  </code></pre>