通过spring的模板新建一个工程
然后在其中额外添加
<dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> </dependency> <!-- tomcat 的支持.--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> <scope>provided</scope> </dependency>
最关键的是
要在项目下生成webapp
file->project Structure 设置webapp
注意:其路径在
src/main下
配置文件如下