项目结构:
1、首先在pom.xml中添加依赖
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
2、查看项目target目录下是否有自己编写的jsp文件:
如果没有的话,有如下2种方法解决:
2.1 可以修改下配置:Edit Configarations…, 修改Working directory为:$MODULE_WORKIG_DIR$。
2.如果idea中没有Working directory选项,在pom.xml中添加如下代码
<build>
<resources>
<resource>
<directory>src/main/webapp</directory>
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
</build>
启动项目后再target中会发现有WEB_INF文件