Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple contexts pointing to the same application

 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Daniel Rhoades
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should work fine.
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic