Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

tomcat web application root context  RSS feed

 
Aadil Shaik
Greenhorn
Posts: 25
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:

I have an issue with my web application's root context URL.
I use maven to build the war file and i get the war file with the name WebApp-0.0.1-SNAPSHOT.war
I can only access the application with the URL http://domain:8080/WebApp-0.0.1-SNAPSHOT/faces/secured/index.xhtml
But i want to access it in a consistent way like http://domain:8080/WebApp/faces/secured/index.xhtml
how to keep the root context url consistent.

thanks
Aadil
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you copy the WAR into the TOMCAT_HOME/webapps directory, the context path will be the same as the name of the WAR (minus the ".war" extension).

If you create a Context XML file in TOMCAT_HOME/conf/Catalina/localhost, the context path will be the name of the Context XML file (minus the ".xml" extension). But you would have to update the docBase attribute to point to the current version of the WAR

For testing, I don't bother building a WAR file, i just point the docBase of my context XML file to my project's Maven target directory, where the exploded version of the WAR is built (and zipped from) in the subdirectory whose name matches the project. So there's neither major nor snapshot version names that have to be changed.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!