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