<!-- 引入jstl标签,配套jsp使用,可以不导入 -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- 配置内嵌的tomcat解析jsp -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
-
- 在application.yml文件中配置试图解析前缀和后缀,spring.mvc.view.prefix, spring.mvc.view.suffix
spring: profiles: # Activate test configuration active: dev mvc: view: # Configure prefix prefix: / # Configure suffix suffix: .jsp
@Controller @RequestMapping("user") public class UserController { @RequestMapping("findAll") public String findAll() { System.out.println("findAll"); return "index"; } }
-
-
- 如果处理完上述操作,仍不支持jsp运行 (新版本似乎不用配置这个)Edit Configuration --> Working directory --> $MODULE_DIR$