title: Tomcat 8 Change Context Path from context.xml
body: <p>I am trying to deploy a web app in tomcat 8 where the context path should be different from the war file name.</p>
  
  <p>We should be able to do this by adding a context.xml file in META-INF folder in web app according to <a href="https://tomcat.apache.org/tomcat-8.0-doc/config/context.html" rel="nofollow">this tomcat documentation</a>. I created this file with the following content, but this does not change the context path to mypath.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Context path="/mypath" docBase="webapps/myWarWeb-1.0.0-SNAPSHOT.war" /&gt;
  </code></pre>
  
  <p>Tried changing the docBase value to <code>webapps/myWarWeb-1.0.0-SNAPSHOT</code>, <code>myWarWeb-1.0.0-SNAPSHOT.war</code> and <code>myWarWeb-1.0.0-SNAPSHOT</code> without any success.</p>
  
  <p>Any idea on this?</p>
  
  <p>Thanks,
  Akalanka.</p>