繁体   English   中英

SpringBoot Thymeleaf无法解析模板

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM