my dog learned polymorphism
The moose likes Tomcat and the fly likes Multiple .War files on Tomcat container Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Multiple .War files on Tomcat container" Watch "Multiple .War files on Tomcat container" New topic

Multiple .War files on Tomcat container

Rob Jon

Joined: May 22, 2008
Posts: 12
Need help in configureing Tomcat container with multiple .war files. Which means i want to use one tomcat container for multiple websites. Is it possible? if yes how can i do it.

Please help and thanks to all in advance.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63552

Of course it is. Each web app is termed a "context". The Tomcat docs and the Servlet Spec explain it all in great detail.

[Asking smart questions] [About Bear] [Books by Bear]
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Just upload your war files to the webapp directory.

The name of the war file will become the context root.

So, on my website,, I upload a file named associate.war to the webapps directory of Tomcat, and tomcat deploys the application. I can then access my webapp through

I also have a war file named thesimpsons.war which I deploy to the same server. It's another web app. But once in the webapps directory, you can access the landing page through:

So, this is just a simple, live example, of multiple war files being deployed to a single tomcat server.

-Cameron McKenzie
Rob Jon

Joined: May 22, 2008
Posts: 12
thanks Cameron for your response. it help me a lot.
I agree. Here's the link:
subject: Multiple .War files on Tomcat container
jQuery in Action, 3rd edition