I know that in a default Tomcat 8 configuration I can drop a file foo.war
file into the webapps/
directory, and Tomcat will autodeploy my web app with a context path of /foo/
.
Bu what WAR filename would I use if I wanted the context path to be /foo/bar
?
Finally, the context path of an application can be defined while uploading it through the manager REST API. This can be done with a PUT request to http://localhost:8080/manager/text/deploy?path=/foo , where the request data is the WAR file to be deployed, and the path query parameter is the desired context path.
xml. The second option is to set the context path of the application in the server. xml (which is located at $CATALINA_HOME\conf). Note: defining the context path manually has the side effect that the application is deployed twice by default: at http://localhost:8080/ExampleApp/ as well as at http://localhost:8080/.
looking at the docs tomcat.apache.org/tomcat-7.0-doc/config/context.html docbase is the path/to/yourApp and path must be "" (so an empty string) meaning the root context. – Fabio Bonfante.
Deploying a WAR file named foo#bar.war
into webapps
would result in a context path of /foo/bar
. See Apache Tomcat 8 Configuration Reference: The Context Container: Naming.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With