Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specifying a nested context path in Tomcat using autodeploy inside webapps/

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?

like image 327
Garret Wilson Avatar asked Nov 02 '16 00:11

Garret Wilson


People also ask

How do I create a context path in web xml?

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.

Where do I put the context path in server xml?

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/.

What is Docbase in Tomcat context?

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.


1 Answers

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.

like image 53
Garret Wilson Avatar answered Sep 21 '22 00:09

Garret Wilson