There was an unexpected error (type=Internal Server Error, status=500).

An error happened during template parsing (template: "class path resource [templates/stu/stu.html]")
错误500,错误出现在html页面中

  • 原因:在前端使用了session取attribute,但session过期导致设置的attribute变为null,无法取值,页面报错
  • 解决方法:三元运算作判断,防止session过期导致的空值无法运行
操作者:<text th:text="${session.S }==null?'null':${session.S.sname}"/>,角色:<text th:text="${session.S }==null?'null':${session.S.role.rname}"/>&nbsp;&nbsp;&nbsp;
posted @ 2021-08-06 16:59  江亭夕望  阅读(3710)  评论(0)    收藏  举报