springboot -- thymeleaf重新跳转时的bug

出现这种情况有两种可能:

1、像网上说的: 没有引用模板引擎的语句
<html lang="en" xmlns:th="http://www.thymeleaf.org">

2、<div th:text="${user.account}">这里显示欢迎信息</div>
你没有把 user 对象传送到该页面中, 当 user 调用 account 属性时因为 user 不存在而报错。 但你不调用 user 对象的属性时即使你不传 user 过来也是不会报错的

相关文章: