• 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

Deploying a web-application within an application

 
Ranch Hand
Posts: 90
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone..
I have a web application that is running .. lets say the url is www.submission.com/submit . I have a saperately developed web app that I would like to deploy at the location www.submission.com/submit/test.
How can I do this ?? Can I put the war file of the new application in the lib folder of the existing application and configure the web.xml to call that web application for that url pattern ?? I am not sure .. Just speculating ..
Please help

Thanks in advance
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, you cannot place a WAR within a WAR. Each WAR is a stand-alone entity and its structure is defined by the J2EE spec - which among other things says that certain files and directories must be located at certain absolute places within the WAR file. Exploding the WAR file into a physical disk directory tree doesn't change that.

But what you really want is to provide 2 different contexts, where one context path is and extended version of the other context path. Since each context can locate its WAR anywhere it wants, actual physical embedding of a WAR isn't required.

The real question is "can Tomcat be directed to match first against a longer context path, then fall back to a shorter path if the longer match fails?". I don't know. It might even do that by default, although I'd have to RTFM, or maybe even the source code.

Assuming it doesn't, however, an alternative would be to employ a URL rewriting scheme so that, for example www.submission.com/submit/test remaps to www.submission.com/test and www.submission.com/submit (without the "/test") passes through unchanged.
 
Dhaval J. Patel
Ranch Hand
Posts: 90
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply,
I'd go with the URL rewriting method. Should work fine
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic