1、创建webapp目录,并在Project Structure中设置为资源文件夹
2、导入依赖
<!-- 内嵌Tomcat对jsp的解析依赖 -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
3、指定Jsp的编译路径
<build>
<!-- 指定Jsp的编译路径 -->
<resources>
<resource>
<!-- 源文件夹 -->
<directory>src/main/webapp</directory>
<!-- 编译位置 -->
<targetPath>META-INF/resources</targetPath>
<!-- 编译资源 -->
<includes>
<include>*.*</include>
</includes>
</resource>
</resources>
</build>
4、配置视图解析器
spring:
mvc:
view:
prefix: /
suffix: .jsp
标签:tomcat,Spring,Boot,Jsp,webapp,embed
From: https://www.cnblogs.com/duya12345/p/16632946.html