Thymeleaf

Thymeleaf 是一个现代的服务器端 Java 模板引擎,它强调可以通过双击在浏览器中预览的自然 HTML 模板,这对于独立处理 UI 模板(例如由设计人员执行)非常有帮助,而不需要运行服务器。如果你想替换 JSP,Thymeleaf 提供了最全面的功能集,可以轻松完成此类转换。Thymeleaf 正在积极开发和维护中。有关更全面的介绍,请参阅 Thymeleaf项目主页。

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 Thymeleaf project home page.

Spring MVC 对 Thymeleaf 的集成由 Thymeleaf 项目管理。该配置涉及一些 Bean 声明,例如`ServletContextTemplateResolver`、SpringTemplateEngine`和`ThymeleafViewResolver。有关更多详细信息,请参阅 Thymeleaf+Spring

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 Thymeleaf+Spring for more details.