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

ResourceUrlProviderExposingInterceptor not set on the resourceHandlerMapping [SPR-12279] #16884

Closed
spring-projects-issues opened this issue Oct 1, 2014 · 3 comments
Assignees
Labels
in: web type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Oct 1, 2014

Janning Vygen opened SPR-12279 and commented

ResourceTransformerSupport in the method findResourceUrlProvider (line 90) is trying to get the resourceUrlProvider from a request attribute.

This request attribute should be set by ResourceUrlProviderExposingInterceptor. The Interceptor should be "configured by default in the MVC". But this is not always the case.

The "resourceHandlerMapping" itself is not configured with such an interceptor (line 371 in WebMvcConfigurationSupport)

Adding this line after line 378 would fix it:
((SimpleUrlHandlerMapping) handlerMapping).setInterceptors(getInterceptors());

The access is need to resolve Url Path in transforming Css Ressources.


Affects: 4.1 GA

Referenced from: commits 2df03d6

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 1, 2014

Rossen Stoyanchev commented

Good catch. This issue is specific to the MVC Java config which sets the interceptors on every HandlerMapping it creates. In the XML namespace interceptors are registered as MappedInterceptor and that is in turn auto-detected from AbstractHandlerMapping.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 13, 2014

Rossen Stoyanchev commented

Modified title (was: "Missing ResourceUrlProvider in ResourceTransformerSupport ")

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 13, 2014

Rossen Stoyanchev commented

I've made this change. Note that this is still not setting all interceptors from the registry since would likely cause surprises (especially with Boot's auto config mapping resources to "/**").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web type: bug
Projects
None yet
Development

No branches or pull requests

2 participants