tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terence M. Bandoian" <>
Subject Context Path for a subdirectory
Date Sat, 01 Dec 2012 04:02:22 GMT
On 11/30/2012 2:00 PM, Caldarale, Charles R wrote:
>> From: Terence M. Bandoian []
>> Subject: Context Path for a subdirectory
>>> A webapp can never be nested inside another, so what you're trying
>>> to do is nonsensical.
>> I don't mean to be argumentative but, with Tomcat 6.0.29, I found that
>> static files from an images subdirectory of a web application were not
>> cached by Internet Explorer 7.  As a workaround, I created a context for
>> the images subdirectory and left it nested in the web application.  The
>> files from that directory were then cached by IE7.  The difference was
>> that the following response headers were included when there was no
>> separate context defined for the subdirectory:
>> Pragma: No-cache
>> Cache-Control: no-cache
>> Expires: Wed, 31 Dec 1969 18:00:00 CST
>> I realize this is a non-standard configuration but it worked with 6.0.29
>> and 6.0.35.
> It may accidentally work in some versions, but it is in no way a supported configuration.
> I think the effort would be better spent in figuring out how to control the headers properly
rather than inventing something that is known to be contrary to the spec.
>   - Chuck

Hi, Chuck-

As I mentioned, I realize this is a non-standard configuration. Also, 
this was a fairly simple, but probably fairly common, use case:

- single web application
- static files in subdirectories to be delivered by Tomcat (no HTTPD 
front end)

I experimented with deploying the subdirectories as separate, un-nested 
applications but that only added complexity with no real benefit so I 
opted for the simpler solution.  Given more time, I might have tracked 
down the reason for the no-cache headers - which I did attempt to do - 
but this worked reliably.  And I'm not sure it's technically contrary to 
the spec.  It certainly didn't violate anything I read in the Tomcat 
configuration reference.  In fact, as previously mentioned in another 
post, the documentation [1] states:

"The web application used to process each HTTP request is selected by 
Catalina based on matching the longest possible prefix of the Request 
URI against the context path of each defined Context."

I didn't see any mention of restrictions on the locations of context roots.

-Terence Bandoian


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

View raw message