Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServletContextResourcePatternResolver fails to resolve resources when an app is using a foo#bar.war filename [SPR-10471] #15104

Closed
spring-issuemaster opened this issue Apr 17, 2013 · 0 comments
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Apr 17, 2013

Rostislav Hristov opened SPR-10471 and commented

The issue can be reproduced with WAR files using the following naming scheme:
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming

The foo#bar.war name is required when you want to achieve a deep context path value like /foo/bar.

The ServletContextResourcePatternResolver and the UrlResource implementation which is used internally do not provide any handling for special characters like #. This leads to a MalformedURLException.

The private doRetrieveMatchingJarEntries method of the ServletContextResourcePatternResolver cannot be overridden and the only workaround at the moment is to duplicate the whole class logic in a custom implementation. A simple encoding of the special character fixes the issue.


Affects: 3.2.2

Referenced from: commits be224e1, 1f0f46f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.