This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes One War file with multiple webapps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "One War file with multiple webapps" Watch "One War file with multiple webapps" New topic

One War file with multiple webapps

Rahul Shivsharan
Ranch Hand

Joined: Jun 17, 2009
Posts: 83
First let me tell you what i am trying to achive.

I was reading Head First Servlet and JSP, there is an diagram which has a folder strtucture it is as follows,

| |_index.html
| |_web.xml
| |_classes

In above folder struture we can see that there are two applications deployed on tomcat

This is what i'm trying to achive ,
what it did is i created two web application and bundled up in a single WAR file and deployed on JBOSS server
but it give an error on command promplt ie.

Let me tell you what i'v done

My WAR which is named "WebApp.war" contains Folders Struture like this (ie. once you click on *.war file and it opens in WinRar it looks like the following)

| |_lib
| |_classes
| | |_com
| | |_packageOne
| | |
| |_web.xml
| |_jboss-web.xml

or take it as

If you unzipe the war file you will see two web-apps
those are




From above diagram you can see the the second we application "AppTwo" also has the same folder struture.

now let me give what it have written in jboss-web.xml and web.xml of AppOne

In second app its

now on my web browser in address i type

But it doesn't loads

So my doubts are
1> Can a war file can have multiple web applications as per the above tree.

2> If yes what should be the context-path , it should start from the folder name which on the top of the web applications which is in my case "WebApp"

can any body please help me out
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41073
Can a war file can have multiple web applications as per the above tree.


Ping & DNS - my free Android networking tools app
David Newton

Joined: Sep 29, 2008
Posts: 12617

GoodBad S/N ratio.
I agree. Here's the link:
subject: One War file with multiple webapps
Similar Threads
Error 500- Internal servlet error
getting error when deploying web app in weblogic 10.0
how to set domain namin on jboss as 4.0.5
Getting error while upgrading my running application from jboss-4.2.1.GA to jboss-6.0.0.Final.
Incompatible Java EE specification level?