Meaningless Drivel is fun!
The moose likes Tomcat and the fly likes Where to put war file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Where to put war file" Watch "Where to put war file" New topic

Where to put war file

sardar waqas ahmed

Joined: Oct 19, 2011
Posts: 16
Hi i am using apache-tomcat-7.0.22 and eclipse . i want to deploy war file in tomcat .should i place it in webapps folder in tomcat directory or somewhere else.thanks in advance
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10747

Each Tomcat installation contains the "How to pages" like this one which should provide you the information you are looking for

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
sardar waqas ahmed

Joined: Oct 19, 2011
Posts: 16
i cannot understand what the page is saying kindly tell me in which folder should i paste my war file
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17149

You can put the WAR wherever you want. Some places are, of course, better than others. The main constraint is that the directory that serves to contain the WAR has to be readable by Tomcat.

Tomcat has a "webapps" directory and most people use that, since they don't have to setup context information and it's a common, well-known place to hold WARs. My serious apps treat WARs as independent products, which have their own product directories and the WARs live there, instead. I use a TOMCAT_HOME/conf/Calatlina/localhost/xxxxx.xml Context file that points to that WAR using the appBase attribute.

There are roughly about 7 places and ways to deploy WARs, and that's not even including the alternatives such as using the Tomcat Manager webapp to upload and install the WAR.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Where to put war file
It's not a secret anymore!