SpringBoot支持thymeleaf的自动装配,因此只需加入如下配置就可使用:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
springboot默认为thymeleaf提供了很多的属性来指定义相关配置,实例如下
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.mode=HTML
spring.thymeleaf.prefix=classpath:/templates/