This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Servlets and the fly likes Multiple contexts pointing to the same application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Multiple contexts pointing to the same application" Watch "Multiple contexts pointing to the same application" New topic
Author

Multiple contexts pointing to the same application

Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Does anyone know if this is in the specs?

What I want to do is, be able to have one application/war file, but have multiple web application contexts.
This will allow me to have one code base, but setup different DataSources, so each context will be connecting to a different database or a different schema.

I came accross this thread on Sun Java forums -

Java Forums - Multiple Contexts, Single Project/App

Apparantly, it is possible to do this in Tomcat. But what about other application servers, and does this violate the J2EE specs in any way?


The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny Gill Tweets
Daniel Rhoades
Ranch Hand

Joined: Jun 30, 2004
Posts: 186
Should be fine, just make sure the WAR and context paths are different - the server should then see them as 2 completely separate apps - thus no breaking of the J2EE spec


Drinking more tea is the key...
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

It should work fine.


Groovy
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Thanks guys.
 
GeeCON Prague 2014
 
subject: Multiple contexts pointing to the same application