1,如果你的pom.xml里面有下面这个依赖,就把它删除,这个依赖会让你的项目默认返回template下的页面
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>
2,在application.yml里面进行配置
spring: mvc: view: prefix: /page/ suffix: .jsp
3,如果你返回jsp页面出现让你下载的情况,不要慌,那是因为缺少jsp依赖
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jsp-api</artifactId>
</dependency>
4,结束。