1.首先在pom.xml中引入thymeleaf依赖
<!--Thymeleaf,是基于3.x开发-->
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
</dependency>
2.在页面上的头部引入如下:
<html lang="en" xmlns:th="http://www.thymeleaf.org">
本文档介绍了如何在Spring Boot项目中集成Thymeleaf模板引擎,包括在pom.xml文件中添加必要的依赖,以及在HTML页面中引入Thymeleaf的命名空间,为前端开发提供便利。
1万+

被折叠的 条评论
为什么被折叠?



