- 在pom.xml中新增以來
<!-- 新增controller return跳轉以來 -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
複製程式碼
- application.yml中配置jsp頁面路徑的字首和字尾
spring:
mvc:
view:
prefix: /WEB-INF/jsp/
suffix: .jsp
複製程式碼
- return方法執行跳轉
@RequestMapping(value = "/show")
public String index() {
return "err";
}
複製程式碼