【发布时间】:2018-09-16 16:04:35
【问题描述】:
我有一个包含页脚部分的 layout.html:
<footer th:fragment="site-footer">
© Spring MVC Blog System, 2016
</footer>
我想要它作为我的 index.html 的替代品:
<div th:replace="layout :: site-footer"></div>
应该很简单,但我还是遇到异常,不知道为什么。
【问题讨论】:
-
Exception processing template "index": Exception parsing document: template="layout", line 2 - column 16 (index:12)你看到了吗,layout.html 的第 2 行 - 第 16 列是什么 -
从
<html xmlns:th="http://www.thymeleaf.org">行粘贴您的模板代码。