SpringBoot使用jsp
需要添加jsp解析器依赖
<!-- jsp --> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> </dependency>
配置资源目录
<!-- build标签中 --> <!-- jsp文件资源目录 --> <resources> <resource> <directory>src/main/webapp</directory> <targetPath>META-INF/resources</targetPath> <includes> <include>**/*.*</include> </includes> </resource> </resources>
注册视图解析器,前缀后缀
spring: mvc: view: prefix: / suffix: .jsp