]
Stuart Douglas resolved WFLY-937.
---------------------------------
Fix Version/s: 8.0.1.Final
Resolution: Done
ServletContext.getResource() doesn't work correctly for files
containing hash characters
----------------------------------------------------------------------------------------
Key: WFLY-937
URL:
https://issues.jboss.org/browse/WFLY-937
Project: WildFly
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Web (Undertow)
Affects Versions: JBoss AS7 7.2.0.Final, 8.0.0.CR1
Environment: Linux 3.2.0-30-generic Ubuntu SMP x86_64 GNU/Linux
Reporter: Christian Kaltepoth
Assignee: Stuart Douglas
Fix For: 8.0.1.Final
Attachments: as7-url-bug.zip
{{ServletContext.getResource()}} returns an invalid URL if the file name contains {{#}}
characters.
Example:
{code:java}
URL url = servletContext.getResource("/file#1.txt");
{code}
The resulting URL object will be spitted at the {{#}} character like this:
{code}
url.toString(): jndi:/default-host/tomcat-url-bug/file#1.txt
url.getPath(): /default-host/tomcat-url-bug/file
url.getRef(): 1.txt
{code}
Calling {{url.openStream()}} will throw a {{FileNotFoundException}}.
This is a known Tomcat issue fixed in 7.0.28.
References:
https://issues.apache.org/bugzilla/show_bug.cgi?id=53257
https://issues.apache.org/bugzilla/show_bug.cgi?id=51584
According to the discussion on the Tomcat issue tracker, there are also problems for
other characters which have special meaning in URLs.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: