簡體   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