1。跳Html 在pom.xml里加上权限
<!--html页面-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
2,把RestController换成Controller 如图:
3.直接在controller 控制器里返回Html页面
4。在templates 目录下创建一个HTML,注意HTML里面的红圈!! 如图:
5.在application.properties里面添加html的位置 如图:
6.运行结果: