SpringBoot-Web-Thymeleaf模板引擎

官网:https://www.thymeleaf.org/

使用:

  • 只需要导入thymeleaf启动器即可
       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

在这里插入图片描述

在这里插入图片描述

Thymeleaf 基础测试

  1. 在接口里自定义数据
  2. 在html增加Thymeleaf的约束 xmlns:th="http://www.thymeleaf.org"
  3. 在html里根据Thymeleaf的语法规则取数据
    在这里插入图片描述

thymeleaf 基础语法

不同类型数据的标签
在这里插入图片描述

不同类型数据的取值方法
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_40429067/article/details/113612346
今日推荐