This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Tomcat and the fly likes Running project outside Tomcat webapp folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Running project outside Tomcat webapp folder" Watch "Running project outside Tomcat webapp folder" New topic
Author

Running project outside Tomcat webapp folder

Mohit Jain
Ranch Hand

Joined: Jun 04, 2007
Posts: 74
Hi Ranchers

How can we run a project in Tomcat by putting its project directory somewhere else(like under C:\) other than "tomcatxx/webapp" directory.

Thanks
[ January 25, 2008: Message edited by: Mohit Jain ]

SCJP 5.0, SCWCD in progress
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You can create a context node with docBase attribute that points to your app's root directory.This can be done either in tomcat/conf/server.xml (old way) or in a context fragment file under tomcat/conf/Catalina/localhost.

If you create a context fragment file, the app will be auto-deployed as soon as you place the context fragment file in the localhost directory.

See:
http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html#A%20word%20on%20Contexts


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
Consider Paul's rocket mass heater.
 
subject: Running project outside Tomcat webapp folder