Bug 53467 - 7.0.28 will no longer accept our jsp filenames
Summary: 7.0.28 will no longer accept our jsp filenames
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.28
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2012-06-25 21:56 UTC by Nate Carlson
Modified: 2012-06-27 18:55 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Nate Carlson 2012-06-25 21:56:46 UTC
We are currently running Tomcat7 7.0.27, and attempting to upgrade to 7.0.28.

Some of our jsp files have square brackets and commas in the filenames, ie:


With 7.0.27, this works fine. With 7.0.28, an error is thrown to the 'localhost.<date>.log' file, IE:

Jun 25, 2012 4:17:42 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Failed to locate resource [/WEB-INF/templates//com.example.standard/CMContainer.asHeaderItem[_,_,closings].jsp] in context [/cae]
java.net.URISyntaxException: Illegal character in path at index 123: jndi:/localhost/cae/WEB-INF/templates/com.example.standard/Container.asHeaderItem[_,_,closings].jsp
        at java.net.URI$Parser.fail(URI.java:2810)
        at java.net.URI$Parser.checkChars(URI.java:2983)
        at java.net.URI$Parser.parseHierarchical(URI.java:3067)
        at java.net.URI$Parser.parse(URI.java:3015)
        at java.net.URI.<init>(URI.java:806)
        at org.apache.catalina.core.ApplicationContext.getResource(ApplicationContext.java:537)
        at org.apache.catalina.core.ApplicationContextFacade.getResource(ApplicationContextFacade.java:201)
        at org.springframework.web.context.support.ServletContextResource.exists(ServletContextResource.java:101)

Looks like this is the change that is breaking things:

Was this intentional? Or is our naming actually OK and this is a new bug?
Comment 1 Mark Thomas 2012-06-27 12:59:09 UTC
Just for information (to save others having to look up RFC 2396) ',' is reserved, '[' is not permitted and ']' is not permitted. All three must be escaped before being used.

This does look like a Tomcat bug at this stage.
Comment 2 Mark Thomas 2012-06-27 17:53:05 UTC
r1345357 is not responsible for this. It looks like r1344890 is.

I am currently looking for a solution that works with this bug, bug53257 and bug51584.
Comment 3 Mark Thomas 2012-06-27 18:55:11 UTC
Fixed in trunk and 7.0.x and will be included in 7.0.29 onwards.