1、maven引入依赖
1 <!--JSP--> 2 <!-- servlet依赖 --> 3 <dependency> 4 <groupId>javax.servlet</groupId> 5 <artifactId>javax.servlet-api</artifactId> 6 </dependency> 7 <dependency> 8 <groupId>javax.servlet</groupId> 9 <artifactId>jstl</artifactId> 10 </dependency> 11 <!-- tomcat的支持--> 12 <dependency> 13 <groupId>org.apache.tomcat.embed</groupId> 14 <artifactId>tomcat-embed-jasper</artifactId> 15 </dependency>
2、配置文件中加入映射路径:
1 spring: 2 # 页面 3 mvc: 4 view: 5 prefix: /WEB-INF/pages/ 6 suffix: .jsp
3、在配置路径下放置jsp页面
4、controller访问
然后就ok了