2023-04-19 23:26:16 +08:00
|
|
|
[[mvc-view-thymeleaf]]
|
|
|
|
= Thymeleaf
|
2023-04-19 23:26:17 +08:00
|
|
|
:page-section-summary-toc: 1
|
2023-04-19 23:26:16 +08:00
|
|
|
|
2023-04-19 23:26:17 +08:00
|
|
|
[.small]#xref:web/webflux-view.adoc#webflux-view-thymeleaf[See equivalent in the Reactive stack]#
|
2023-04-19 23:26:16 +08:00
|
|
|
|
|
|
|
Thymeleaf is a modern server-side Java template engine that emphasizes natural HTML
|
|
|
|
templates that can be previewed in a browser by double-clicking, which is very helpful
|
|
|
|
for independent work on UI templates (for example, by a designer) without the need for
|
|
|
|
a running server. If you want to replace JSPs, Thymeleaf offers one of the most
|
|
|
|
extensive sets of features to make such a transition easier. Thymeleaf is actively
|
|
|
|
developed and maintained. For a more complete introduction, see the
|
|
|
|
https://www.thymeleaf.org/[Thymeleaf] project home page.
|
|
|
|
|
|
|
|
The Thymeleaf integration with Spring MVC is managed by the Thymeleaf project.
|
|
|
|
The configuration involves a few bean declarations, such as
|
|
|
|
`ServletContextTemplateResolver`, `SpringTemplateEngine`, and `ThymeleafViewResolver`.
|
|
|
|
See https://www.thymeleaf.org/documentation.html[Thymeleaf+Spring] for more details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|