title: How to set up cross-context between webapps deployed inside ear in JBoss 4
body: <p>We have 2 war files inside an ear file deployed in JBoss 4. We need to switch between web app contexts for which we are using UrlRewriteFilter. </p>
  
  <p>The problem we are facing is we are not able to perform a requestDispatcher.forward() between these webapps. I believe this can be achieved by setting cross-context attribute to true in the web container (Tomcat 5.5). We have done the following setting -</p>
  
  <p>In /default/deploy/jbossweb-tomcat55.sar/server.xml</p>
  
  <pre><code>&lt;Host name="localhost"
          autoDeploy="false" deployOnStartup="false" deployXML="false"&gt;
  &lt;Context path="/esa" docBase="/deploy/app.ear/webapp1.war" 
      debug="0" crossContext="true"/&gt;
  &lt;Context path="/mstrapp" docBase="/deploy/app.ear/webapp2.war" 
      debug="0" crossContext="true"/&gt;
  &lt;/Host&gt;
  </code></pre>
  
  <p>But during JBoss startup, it tries to deploy these 2 webapps and throws errors related to libraries not found (they are inside the ear).</p>
  
  <p>How do we achieve cross context in this case ?</p>
  
  <p>Thanks
  Sundeep</p>