{ "title": "Thymeleaf Spring Boot Integration Example", "description": "Example showing common Thymeleaf patterns with Spring Boot, including template configuration, expressions, fragments, and Spring Security integration", "version": "3.1.5.RELEASE", "springBootVersion": "3.4.x", "mavenDependency": { "groupId": "org.springframework.boot", "artifactId": "spring-boot-starter-thymeleaf", "description": "Auto-configures Thymeleaf with SpringResourceTemplateResolver and SpringTemplateEngine" }, "engineConfiguration": { "type": "ThymeleafEngineConfig", "templateResolvers": [ { "type": "SpringResourceTemplateResolver", "prefix": "classpath:/templates/", "suffix": ".html", "templateMode": "HTML", "characterEncoding": "UTF-8", "cacheable": false } ], "dialects": [ { "class": "org.thymeleaf.spring6.dialect.SpringStandardDialect", "prefix": "th", "name": "Spring Standard Dialect" }, { "class": "org.thymeleaf.extras.springsecurity6.dialect.SpringSecurityDialect", "prefix": "sec", "name": "Spring Security Dialect" } ], "cacheEnabled": false }, "applicationProperties": { "spring.thymeleaf.prefix": "classpath:/templates/", "spring.thymeleaf.suffix": ".html", "spring.thymeleaf.encoding": "UTF-8", "spring.thymeleaf.cache": "false", "spring.thymeleaf.mode": "HTML" }, "templateExamples": [ { "name": "layout", "path": "templates/layout.html", "description": "Base layout template defining header, nav, content slot, and footer", "html": "\n\n\n Page Title\n\n\n \n
\n \n\n" }, { "name": "userList", "path": "templates/users/list.html", "description": "User list page showing iteration, conditionals, and URL expressions", "modelAttributes": [ { "name": "users", "type": "List", "required": true }, { "name": "totalCount", "type": "long", "required": true } ], "html": "\n\n\n

Users (0)

\n \n \n \n \n \n \n \n \n \n \n
1Nameemail@example.com\n Edit\n Inactive\n
1John Doejohn@example.comEdit
\n\n" }, { "name": "userForm", "path": "templates/users/form.html", "description": "User form demonstrating th:object, th:field form binding, and validation errors", "modelAttributes": [ { "name": "userForm", "type": "UserForm", "required": true } ], "html": "\n\n\n
\n \n
\n \n \n Name error\n
\n
\n \n \n Email error\n
\n
\n \n \n
\n \n
\n\n" }, { "name": "footer", "path": "templates/fragments/footer.html", "description": "Reusable footer fragment with parameterized content", "html": "\n\n\n \n\n" } ], "expressionExamples": [ { "expression": "${user.name}", "type": "Variable", "description": "Access user.name from Spring MVC model" }, { "expression": "*{firstName}", "type": "Selection", "description": "Access firstName on th:object selected bean" }, { "expression": "#{welcome.message}", "type": "Message", "description": "Resolve i18n message from messages.properties" }, { "expression": "@{/users/{id}/edit(id=${user.id})}", "type": "URL", "description": "Build path /users/42/edit with path variable" }, { "expression": "~{fragments/footer :: footer}", "type": "Fragment", "description": "Reference footer fragment from fragments/footer.html" } ] }