1.首先在pom导入依赖,
<!--访问资源路径-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
2.在application.properties中配置模板引擎
#修改访问路径,默认是templates
spring.thymeleaf.prefix=classpath:/templates/
3.在templates下建立html文件