1. 作用:
不需要 服务端的支持,就能够被以 html 的方式打开,方便前端人员独立设计与调试,
jsp 就不行了, 不启动服务器 jsp 都没法运行出结果来。
2.修改 pom.xml, 增加了对 thymeleaf 的支持。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
3.配置application.properties
#thymeleaf 配置
spring.thymeleaf.mode=HTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
#缓存设置为false