在使用SpringBoot向的时候会遇到访问WEB-INF下的jsp页面找不到的情况
如下图是我的配置
访问的时候如下遇到这种情况需要在maven中加入下面的代码,把webapp转装成资源目录
<build>
<resources>
<!--注册webapp目录为资源目录-->
<resource>
<directory>src/main/webapp</directory>
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
以及添加maven依赖
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>9.0.37</version>
</dependency>