1、添加依赖
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
2.添加webapp/WEB-INF/jsp文件夹
3、配置文件修改
application.yml
spring:
mvc:
view:
prefix: /
suffix: .jsp
或者
application.properties
spring.mvc.view.prefix=/
spring.mvc.view.suffix=.jsp
4、pom文件修改
在build节点中添加resources节点
<resources>
<resource>
<directory>src/main/webapp/WEB-INF/jsp</directory>
<!--如果使用springboot自带的tomcat启动,则使用如下配置jsp路径-->
<targetPath>META-INF/resources</targetPath>
<!--如果使用maven启动本地tomcat启动,则使用如下配置-->
<!--<targetPath>/WEB-INF/jsp</targetPath>-->
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- esig.cn 版权所有 湘ICP备2023023988号-3
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务