使用MyBatis如何實(shí)現(xiàn)整合SpringMVC?針對(duì)這個(gè)問題,這篇文章詳細(xì)介紹了相對(duì)應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問題的小伙伴找到更簡(jiǎn)單易行的方法。
1、添加spring相關(guān)jar包
2、配置ehcache jar包。
3、添加ehcache mybatis 適配器jar包(在mybatis官網(wǎng))
4、添加spring mybatis 適配器jar包(在mybatis)官網(wǎng)
5、pom.xml
4.0.0 com.ntjr.mybatisSpring mybatisSpring 0.0.1-SNAPSHOT war 3.4.2 5.1.38 4.3.7.RELEASE org.mybatis mybatis ${mybatis_version} mysql mysql-connector-java ${mysql_connector_version} log4j log4j 1.2.16 org.springframework spring-webmvc ${org.springframework} org.springframework spring-tx ${org.springframework} org.springframework spring-jdbc ${org.springframework} org.springframework spring-orm ${org.springframework} org.aopalliance com.springsource.org.aopalliance 1.0.0 net.sourceforge.cglib com.springsource.net.sf.cglib 2.2.0 org.aspectj com.springsource.org.aspectj.weaver 1.6.10.RELEASE com.mchange c3p0 0.9.5.2 org.mybatis.caches mybatis-ehcache 1.1.0 org.mybatis mybatis-spring 1.3.1 commons-logging commons-logging 1.2 org.apache.taglibs taglibs-standard-impl 1.2.5 org.apache.taglibs taglibs-standard-spec 1.2.5