Bug 50535 - Support resources serving from /WEB-INF/classes/META-INF/resources directory
Summary: Support resources serving from /WEB-INF/classes/META-INF/resources directory
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.5
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-01 09:35 UTC by Attila Király
Modified: 2011-01-20 11:39 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Attila Király 2011-01-01 09:35:40 UTC
Servlet 3.0 introduced the feature to serve static files from META-INF/resources directory. The specification only demands support for this if the META-INF/resources is inside of a jar file in the /WEB-INF/lib directory.

Tomcat passes this requirement because it serves files from jar but not from WEB-INF/classes. It seems Glassfish 3.0.1 however supports both type of locations. It would be nice if Tomcat would support it too.
Comment 1 Mark Thomas 2011-01-20 11:39:49 UTC
Application server specific extensions to the Servlet specification are a really bad idea since they harm portability - the reason why we have a specification in the first place. On that basis I almost closed this one as WONTFIX.

However, I do see a valid use case and one that I suspect will lead to a change in the spec. Some environments, particularly IDEs, unpack all their JARs into the WEB-INF/classes directory. This would break static resources in JARs. Enabling this option works around this issue.

Since this is a proprietary extension, it is disabled by default and controlled by an attribute on the StandardContext but is not part of the Context interface.