<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
application.yml里添加
spring:
thymeleaf:
prefix: classpath:/templates/
创建controller 添加@Controller注解
方法:
@RequestMapping("**")
public String to(){
return html的名字;
}