初めて Thymeleaf を使用していますが、テンプレートについて明確にする必要があります。ドキュメントを正しく理解していれば、テンプレート (またはその一部) を自分のページに含めることができます。たとえば、次のように書くことができます。
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="template/layout :: header">
</head>
<body>
Hello world
<div th:include="template/layout :: footer"></div>
</body>
</html>
しかし、実際には、テンプレートの逆の使用方法が必要です。ページにテンプレートフラグメントを含める代わりに、テンプレート内にページを含めたい、そのようなもの:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
...
</head>
<body>
<div id="my-template-header">...</div>
<div id="the-content">
<!-- include here the content of the current page visited by the user -->
???
</div>
<div id="my-template-footer">...</div>
</body>
つまり、 Thymeleaf でSitemesh デコレータ タグに相当するものを作成する方法はありますか?
ありがとう