my dog learned polymorphism
The moose likes Tomcat and the fly likes Separate the WAR from server directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Separate the WAR from server directory" Watch "Separate the WAR from server directory" New topic

Separate the WAR from server directory

Chee Seng

Joined: May 30, 2004
Posts: 15
This is the thing I want to do.

Store the WAR file in �/apps/deploy/myApp.war�
Deploy the WAR from �/apps/deploy�
Future deployment (restart server or replace file autodeploy) will take the WAR file from �/apps/deploy�.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

If you create a context fragment file and put it under {tomcat install}/conf/Catalina/localhost/{contextPathName}.xml you can set the docBase attribute to any path you like.

For example, if my context path were to be "myApp" the file's name would be
"myApp.xml" and would look like:

for a complete list of Context attributes.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Separate the WAR from server directory
It's not a secret anymore!