• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

One War file with multiple webapps

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,

Apache_Home
|_beerAdvice
| |_index.html
| |_WEB-INF
| |_web.xml
| |_classes
|_datingApp

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)

WebApp
|_AppOne
| |_WEB-INF
| |_lib
| |_classes
| | |_com
| | |_packageOne
| | |_FirstServlet.java
| |_web.xml
| |_jboss-web.xml
|_AppTwo
META-INF


or take it as

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

WebApp/AppOne
WebApp/AppOne/WEB-INF
WebApp/AppOne/WEB-INF/lib
WebApp/AppOne/WEB-INF/web-xml
WebApp/AppOne/WEB-INF/jboss-web.xml
WebApp/AppOne/WEB-INF/classes
WebApp/AppOne/WEB-INF/classes/com/packageOne/FirstServlet


WebApp/AppTwo
WebApp/AppTwo/WEB-INF
WebApp/AppTwo/WEB-INF/lib
WebApp/AppTwo/WEB-INF/web.xml
WebApp/AppTwo/WEB-INF/jboss-web.xml
WebApp/AppTwo/WEB-INF/classes
WebApp/AppTwo/WEB-INF/classes/com/packageTwo/SecondServlet

META-INF



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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Can a war file can have multiple web applications as per the above tree.


No.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
GoodBad S/N ratio.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic