Caused by: org.thymeleaf.exceptions.TemplateInputException: Error resolving template “header”, template might not exist or might not be accessible by any of the configured Template Resolvers (template: “/index.html” - line 46, col 10)
我的header.html与index.html是放在同一个目录下的。
错误根源:
<div th:replace="header::header"></div>
解决:
<div th:replace="/header::header"></div>
本文介绍了一个关于Thymeleaf模板引擎中header.html无法正确被index.html调用的问题及解决方案。错误在于使用了相对路径引用header.html,通过修改为绝对路径解决了问题。
1万+





