基于SpringBoot整合Spring、Spring-MVC和Mybatis
创建新项目myoa
-
IDEA->new->Project,创建一个SpringBoot项目。

image-20220506152354284 -
培训pom.xml,在build节点添加下面内容,使得webapp的静态资源能访问
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> <!-- 添加访问静态资源文件 --> <!-- 代码的作用是让src/main/webapp在编译的时候在resoureces路径下也生成webapp的文件 --> <resources> <resource> <directory>src/main/webapp</directory> <targetPath>META-INF/resources</targetPath> <includes> <include>**/**</include> </includes> </resource> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> </build> -
查看运行结果

image-20220506152314044
...大约 1 分钟

