springboot整合springmvc、mybatis

  springboot简介就不介绍了,主要的特性的将一个web项目打成jar包的形式,省去很多的配置。可用于快速检验数据库中的数据在系统中的实现,分析方案的可行性,同时可以开发小型项目。springboot默认集成的spring以及旗下的一些子项目,所有的配置都是在application.properties中,一般放在src/main/resource(别的地方我没有试过),如下图:

  我的项目中集成了mybatis,导入数据源和spring中一样,springmvc直接是配置就行,默认里面集成了。

  我的项目使用的maven工程,pom中导入的包有如图所示。

有springboot基本jar包,mybatis需要的jar,需要跳转页面解析的servlet jar。

<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>

controller中,目前只是返回modelandview对象的形式能够跳转,别的还未知。

原文地址:https://www.cnblogs.com/fengmao/p/7272381.html