源码:
<div>
验证码: <input type="text" name="code">
<img src="/code/image" alt="">
<span style="color: red" th:text="${#session.getAttribute('error')}"></span>
</div>
报错信息:
解决方案:
将${#session.getAttribute('error')}改为\${(session.error)}
参考:
在Thymeleaf中关于使用#httpSession出现的异常:Exception evaluating SpringEL expression