tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morgan, Russel" <>
Subject RE: Help Linking Static Content In a WebApp before and after (6.0.30.x)
Date Wed, 06 Jun 2012 00:38:43 GMT
I was initially pretty excited about the URL redirect idea, but after some testing, it has
led me back to the same result.

I can make it work with redirects on either version of tomcat.  Pre and Post that patch...
I just can't make the same configuration work for both versions.

As an example: 
Pre-Patch Tomcat
The request:

P Status 404 - /cms/resources/css/gopublish.css
type Status report
message /cms/resources/css/gopublish.css
description The requested resource (/cms/resources/css/gopublish.css) is not available.

I know I can just move that css folder down to the base of the webapp and the above link works

Post-Patch Tomcat 
The request:
P Status 200's across the board

File structure on both webapps is the same:

I can re-direct all around and that works great, but if one URL doesn't work to address the
same asset across versions I am sunk without having code that somehow changes the addressing
behavior based on the version of Tomcat.

This whole issue was caused (in my reading) by changing the logic from:
getPathInfo()   To ...
getServletPath() + getPathInfo()

So the handling on the backend has change so even if you re-direct something , it will be
interpreted differently by each container.

Thanks again for the responses, I certainly need all the help I can get.

Russel Morgan

-----Original Message-----
From: Konstantin Kolinko [] 
Sent: Tuesday, June 05, 2012 1:05 PM
To: Tomcat Users List
Subject: Re: Help Linking Static Content In a WebApp before and after (6.0.30.x)

2012/6/5 Morgan, Russel <>:
> Thanks yes that is the change that caused this issue with how we use static content.
> I am not sure how I mangled my formatting but I went through and cleaned it up, I hope
that helps readability.
> Russ
> Issue formatting recap below:
> =========================
> Tomcat Users:
> Has anyone found a graceful way to handle static content linking that works both pre
and post the the following change?
> We have quite a few customers on earlier versions of Tomcat 6 as well as new customers
picking up later versions that are post this patch.  I am looking for some kind of work around
that works in both generations.
> Here is an example of what we are doing as far as static linking in our webapp.
> So on older tomcat's (prior to 6.0.30) 
> http://localhost:8080/cms/default/css/gopublish.css
> http://localhost:8080/cms/static/css/gopublish.css
> both work to hit items in the root of the webapp so .../cms(as 
> webapp)/css/gopublish.css
> (...)
> I don't see that this problem can be worked around by servlet mapping or filters, since
the core behavior has changed.

Have you looked at UrlRewriteFilter, that I mentioned in my response to the first e-mail?
A link to it can be found here:

Your configuration could be something like this:
		<from casesensitive="true">^/static/(.+)</from>
		<from casesensitive="true">^/default/(.+)</from>

Best regards,
Konstantin Kolinko

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message