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}"/>