Hmm....

In Tomcat versions up through 6.0, I have cases where I have 1 expanded WAR directory (outside Tomcat's webapps, etc) and then numerous disparate Context XML files under Tomcat/conf, each with their own overrides to the original web.xml (e.g. each getting their own data sources, JNDI env values, context name, etc).

It was my understanding that the web.xml override capability of Context was broken in Tomcat 7 (and/or the most recent Tomcat 6??) -- at least for a while, hopefully this has been fixed.

Otherwise, however, this seems to work nicely -- 1 deployment, 'n' URLs with 'n' disparate context paths. It does, of course, load 'n' copies of all the JSPs, etc, etc -- so there's definitely some downside in terms of overhead. It is a quick and dirty way to deploy numerous instances of a web app which has unfortunate singletons, e.g. data sources, where you belatedly discover you want a cardinality of 'n' rather than 1.

--
Jess Holle

On 5/13/2011 8:56 AM, Caldarale, Charles R wrote:
From: JanAa [mailto:jan.aage...@norse-solutions.com]
Subject: Re: Multiple context paths for single deployment
What I want is an alias for the context so that more than
one url can be used for the same application and that the
url used is reflected in HttpServletRequest.getContextPath().
Those are conflicting requirements.  Pick one or the other - you can't have 
both.

(Actually, you can, but it would be a major pain.  If you wrote a filter that 
wrapped every HttpServletRequest object and implemented your own 
getContextPath() method, you could choose to return whatever you want for the 
result.)

  - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to