遇到的问题目前找到两种:
/
开头,例如 /test/hello
/
开头,例如:<footer th:replace="/index::footer"></footer>
@GetMapping("/about-us") public String sysInfo(){ return "students/about-us"; }
错误写法:(不要在前面加入"/")
return "/students/about-us";
引入公共模板时,也不要加‘‘/‘
正确写法:
<header th:replace="main/sys-public :: stu-header"></header>
总结:在代码编写的过程中,要注意规范书写习惯,避免不必要的问题发生。
Springboot项目打包后的页面丢失问题(thymeleaf报错)
原文:https://www.cnblogs.com/116970u/p/10778741.html