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;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM