[jboss-jira] [JBoss JIRA] (WFLY-937) ServletContext.getResource() doesn't work correctly for files containing hash characters
Tomaz Cerar (JIRA)
issues at jboss.org
Mon Feb 10 09:27:28 EST 2014
[ https://issues.jboss.org/browse/WFLY-937?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tomaz Cerar updated WFLY-937:
-----------------------------
Affects Version/s: 8.0.0.CR1
JBoss AS7 7.2.0.Final
> 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
> 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: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list