[英]SpringBoot Thymeleaf Not Resolving Template
我使用的是SpringBoot 1.3.3.RELEASE和Thymeleaf,以IntelliJ为我的想法。 我收到此错误:
org.thymeleaf.exceptions.TemplateInputException: Error resolving template "footer.html", template might not exist or might not be accessible by any of the configured Template Resolvers (about:102)
我正在about.html文件上使用此导入:
<div th:replace="footer.html"></div>
我无法通过IntelliJ或SpringBoot Maven插件使其工作。 我正在使用嵌入式Tomcat运行此项目。 我尝试将片段放入模板下的片段文件夹中
<div th:fragment="footer.html"></div>
任何帮助,将不胜感激。
您的footer.html是什么样的? 如果要使用片段,则必须这样做:
<div th:replace="footer :: fragmentName"></div>
在footer.html中,您会看到类似
<div th:fragment="fragmentName">Hello World</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.