十一、springboot(六)整合Thymeleaf

时间:2025-02-22 22:34:14

1、添加jar包依赖 

  <dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-thymeleaf</artifactId>

</dependency>

2、文件目录

  /src/java/resources/templates
3、修改application.properties

  spring.thymeleaf.prefix: classpath:/templates/

spring.thymeleaf.suffix: .html

4、启动