thymeleaf / thymeleaf-spring

Thymeleaf integration module for Spring
http://www.thymeleaf.org
Apache License 2.0
435 stars 157 forks source link

TemplateProcessingException for #session.getAttribute #209

Open AnujaDalal opened 5 years ago

AnujaDalal commented 5 years ago

ThymeLeaf 3.0.9, Spring-Webflow. Bit new to Thymeleaf. I am getting following exception only in production environment.

org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "(#session.getAttribute('userExists'))" (template: "fragments/loginForm" - line 6, col 8)

Line of code that is affected is:

<div th:if="${(#session.getAttribute('userExists'))}">
...
</div>

Locally it runs correct. On production it fails badly.

I understand that #session is only available in webcontext. Is my application running as standalone on production? Or is something wrong with syntax?

destan commented 5 years ago

I believe this is an application problem and solved in SO https://stackoverflow.com/questions/54961520/thymeleaf-occasional-error-using-session-exception-evaluating-springel-expre hence we can close this issue.