- 在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";
}
复制代码