Skip to content

ResourceUrlEncodingFilter fails when Thymeleaf and the "/**" resource pattern is used [SPR-12630] #17231

Closed
@spring-projects-issues

Description

@spring-projects-issues

Christopher Savory opened SPR-12630 and commented

I could not get ResourceUrlEncodingFilter to work with Thymleaf templates. I believe the problem is that Thymleaf calls encodeURL on all of it's URLs, even standard links. What happens is that ResourceUrlEncodingFilter tries to look up resources of links and can't find them (because they don't exist, but are just mappings) and throws an exception.

I had to create my own filter based on ResourceUrlEncodingFilter that would only encode resources that had specific extensions I wanted encoded. It would be nice if ResourceUrlEncodingFilter used the same set of extensions supplied when the path patterns are supplied to ResourceHandlerRegistry.addResourceHandler and further, only those with a Transformer attached to it.


Affects: 4.1.3

Referenced from: commits spring-attic/spring-framework-issues@25f7f0d

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions