I\'m using Tomcat 7 and would like to set the context root of a war file in the war file itself and have Tomcat autodeploy and pick up this path. I thought I found the way to
The Context path
attribute is ignored unless the path is specified in a hard-coded Context
in server.xml
, which is strongly discouraged, and doesn't take multilevel paths.
The name of the war file, or the name of the Context xml file in tomcat/conf/Catalina/hostname
becomes the path
of the deployed application.
In your case the latter of the two above is the solution, just make sure you put the .war
file outside of the designated appBase
for the Host, or you'll deploy the app twice.
In: conf/Catalina/localhost/myapp#path.xml