Springboot中thymeleaf使用th:include时遇到的问题

时间:2025-04-01 10:59:10

Caused by: : Error resolving template “header”, template might not exist or might not be accessible by any of the configured Template Resolvers (template: “/” - line 46, col 10)
我的与是放在同一个目录下的。
错误根源:

    <div th:replace="header::header"></div>

解决:

    <div th:replace="/header::header"></div>