【发布时间】:2017-06-29 23:43:57
【问题描述】:
我有一个奇怪的问题,当我使用替换或包含时,我的一些 html 文件没有被包含在内。什么会导致这个?
header.html
<header id="header" xmlns:th="http://www.thymeleaf.org">
<div th:replace="/blocks/topbar :: topbar"></div>
</header>
topbar.html
<div class="top-bar">
<div class="container">
<div class="row">
<div class="col-sm-6 col-xs-4">
<div class="top-number"><p><i class="fa fa-phone-square"></i> +0123 456 70 90</p></div>
</div>
<div class="col-sm-6 col-xs-8">
<div class="social">
<ul class="social-share">
<li><a href="#"><i class="fa fa-facebook"></i></a></li>
</ul>
</div>
</div>
</div>
</div><!--/.container-->
</div><!--/.top-bar-->
错误:
org.thymeleaf.exceptions.TemplateInputException: Error resolving fragment: "~{'/blocks/topbar' :: topbar}": template or fragment could not be resolved (template: "blocks/header" - line 3, col 10)
【问题讨论】:
标签: java spring-boot thymeleaf