SpringMVC+MyBatis集成配置-演道网
1.首先我们来看下依赖的pom:
spring 选用的是4.1.4的版本,根据系统需要我们可以选择自己适合的版本。
2.相关的配置文件:
a)spring.xml
xsi:schemaLocation=”http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd”>
b)spring-mvc.xml
xmlns:p=”http://www.springframework.org/schema/p” xmlns:context=”http://www.springframework.org/schema/context”
xsi:schemaLocation=”http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd”>
c)spring-mybatis.xml
xmlns:aop=”http://www.springframework.org/schema/aop”
xsi:schemaLocation=”
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
“>
d)web.xml
使用了druid的数据源,在web中的详细配置可以参看代码。
MyBatis入门学习教程 http://www.linuxidc.com/Linux/2015-02/113771.htm
Java实战应用:Mybatis实现单表的增删改 http://www.linuxidc.com/Linux/2014-06/103456.htm
[Java][Mybatis]物理分页实现 http://www.linuxidc.com/Linux/2014-04/99889.htm
Mybatis快速入门教程 http://www.linuxidc.com/Linux/2013-06/85762.htm
Mybatis的关于批量数据操作的测试 http://www.linuxidc.com/Linux/2012-05/60863.htm
Mybatis中对List
转载自演道,想查看更及时的互联网产品技术热点文章请点击http://go2live.cn