1.使用 th:fragment=“copy” 来把工公共部分抽取处理
举个例子 header.html
//假设这个body是你要的公共部分
<body th:fragment="copy">
</body>
2.thymeleaf中引入片段的基本方式
<div th:insert="你的header.html的路径:: copy"></div>
<div th:replace="你的header.html的路径:: copy"></div>
<div th:include="你的header.html的路径:: copy"></div>