Skip to content

ScriptTemplateView should check template resource [SPR-14729] #19294

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

Closed
spring-projects-issues opened this issue Sep 17, 2016 · 2 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Brian Clozel opened SPR-14729 and commented

The ScriptTemplateView class does not override the checkResource method. This means that, when configuring multiple template resolvers within an application, the ScriptTemplateViewResolver won't properly check if a template is available before trying to render it, thus throwing an exception.
The next view resolvers in the chain are then never called.


Affects: 4.2.7, 4.3.2, 5.0 M1

Reference URL: https://stackoverflow.com/questions/39547340/mustache-and-internalviewresolvers-spring-mvc

Backported to: 4.2.8

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Brian Clozel, I've revised this check to avoid exception swallowing (and full template loading) and rather delegate to getResource directly, making the latter return null in case of no resource found. I hope that's in alignment with your original intention here.

@spring-projects-issues
Copy link
Collaborator Author

Brian Clozel commented

Thanks Juergen Hoeller!

@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.3.3 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants