<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>我们的boot的starter已经整合过了,不需要版本坐标。

创建一个HTML文件。
我们需要再<html>标签里面加点东西。

我直接打开这个html时,他是这样的。

因为我们需要web服务对thymeleaf语法进行处理。


spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=HTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
spring.thymeleaf.cache=false
spring.resources.chain.strategy.content.enabled=true
spring.resources.chain.strategy.content.paths=/**我们也可以再SpringBoot的配置文件中,配置相关设置。
至于使用方法,请参考其他资料吧。