第一需要在application.xml 中添加配置
spring:
thymeleaf:
encoding: UTF-8
mode: HTML5
prefix: classpath:/templates/
suffix: .html
check-template: true
cache: false
之后还要在pom文件中添加jar为
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
此处只处理templates文件下静态页面