1、使用idea软件创建项目
导入依赖:
导入jsp依赖:
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<scope>provided</scope>
</dependency>
导入切面编程aop依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
2、配置maven打包web目录(写在pom.xml的build标签中,把plugins折叠起来,写在plugins后面)
<resources>
<resource>
<directory>src/main/web</directory>
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
3、配置jsp文件的前缀和后缀(写在resources/application.properties配置文件中)
spring.mvc.view.prefix=/jsp/
spring.mvc.view.suffix=.jsp
4、对application.properties进行修改
5、手动添加web目录
在项目名后面添加src\main\
6、启动类添加方法
7、写好实体类、mapper接口、service接口、service接口的实现类serviceImpl、最后在测试类中写入插入方法。
测试类
8、page主页编写与遇到的问题