tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: How to serve two docBases under the same context path
Date Thu, 23 Oct 2008 17:56:33 GMT
nlif wrote:
[...]

I will not, like some others (;-)), presume to guess why you want to do 
this.
But I will presume that you have a clear way to distinguish what are 
links to static content from what are links to dynamic content (e.g. 
static ends in .html,.jpg,.css etc.. while dynamic ends in .jsp etc).

With that premise, I can think of two ways :

1) as others said, set up an Apache on your development environment and 
do what you would do on your production one.
(JkMount and JkUnmount e.g.)

2) use a servlet filter in Tomcat like urlrewrite to catch either the 
links to dynamic content or the others, and rewrite these links to point 
to the other context.
See http://tuckey.org/urlrewrite/
and look at rules like
    <rule>
     <from>/allcontext/([^.]+\.(jpg|html|css))$</from>
     <to type="redirect">/staticcontext/$1</to>
    </rule>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message