I have a simple Spring download application in version 1.5.7, and I'm trying to port it to version 2.0.0. I am almost finished, but there is no last part, and this is Timeleaf.
Everything worked fine in the old version, but after the migration Spring Boot stopped allowing any templates (both pages and emails).
I have all the templates src/main/resources/templates. In addition, I have a default layout called in src/main/resources/templates/layout, which looks like this:
<!DOCTYPE html>
<html>
<head th:replace="fragments/header :: head"></head>
<body>
<div id="page">
<nav class="navigation" th:replace="fragments/navigation"></nav>
<div class="container">
<div layout:fragment="container"></div>
</div>
</div>
</body>
</html>
My pages link to this layout as follows:
<!DOCTYPE html>
<html lang="en"
xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="layout/default">
<body>
<div layout:fragment="container">
...
</body>
</html>
Navigation fragment in a localized folder src/main/resources/templeats/fragments
Spring Boot 2 , ( ). - 2.0.0? .
EDIT: , Thymeleaf 3. , , .
layout:data-layout-decorate=~{layout/default} layout: data-layout-decorate = ~ {layout/default.html},
:
compile('nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect')
, , Spring, ...