Looks like as for the Thymeleaf version 3.1 template extension is supposed to be done using the other mechanism described in Tutorial: Using Thymeleaf (3.1.2.RELEASE), chapter 8.5 Layout Inheritance:
The layout is (src/main/resources/templates/layout/layout_simple.html
):
<!DOCTYPE html>
<html lang="en" th:fragment="layout(title, main)"
xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title th:replace="${title}">Layout title</title>
</head>
<body>
<header>Common block: header</header>
<main id="mainpart" th:replace="${main}">
<p><em>This content must not be visible.</em></p>
</main>
<footer>Common block: footer</footer>
</body>
</html>
The page is (src/main/resources/templates/thymeleaf_first_page_simple.html
):
<!DOCTYPE html>
<html th:replace="~{layout/layout_simple :: layout(~{::title}, ~{::main})}"
xmlns:th="http://www.thymeleaf.org">
<head>
<title>Thymeleaf demo simple</title>
</head>
<body>
<main>
<h1>Thymeleaf template extension simple demo</h1>
<p>Actual page content: [<th:block th:text="${modelValue}" />]</p>
</main>
</body>
</html>
The result is:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Thymeleaf demo simple</title>
</head>
<body>
<header>Common block: header</header>
<main>
<h1>Thymeleaf template extension simple demo</h1>
<p>Actual page content: [some simple value from the model]</p>
</main>
<footer>Common block: footer</footer>
</body>
</html>