1、创建springboot项目,添加以下依赖
<!-- Springboot Web依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- springboot 访问HTML依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
2、application.yml文件里面添加访问配置
spring:
##访问html配置
thymeleaf:
classpath: /templates/