kolorobot/spring-mvc-quickstart-archetype

Remove layout fragment in Custom Error view ?

DBarthe opened this issue · 1 comments

Hello,

I've had a problem with this project when an unexpected exception is raised somewhere during view rendering.

The custom error handler renders the error/general.html view, which makes use of fragments/layout.html, and that failed because it references isAuthenticated() :

Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "#authorization.expression('!isAuthenticated()')" (template: "fragments/layout" - line 27, col 21)

It caused me much confusion because it hides the actual error occurred in the first place .

So the solution for me was to comment the inclusion of the layout header.

Please tell me if I'm wrong because I'm totally new to spring. If not I could submit the fix.

Otherwise thanks for this project :)

@DBarthe I confirm the issue and preapare the fix