SSM整合实例
一、思路 SSH --> Spring+SpringMVC+MyBatis SM整合 --> SS整合 -->SSM 二、大体框架 三、Spring整合MyBatis SqlSessionFactory ->SqlSession -> StudentMapper ->CRUD MyBatis最终通过SqlSessionFactory 来操作数据库,Spring整合MyBatis,其实就是将MyBatis的SqlSessionFactory交给Spring。 1、jar包 2、配置 与spring整合时,mybatis的配置文件conf.xml(数据源+mapper.xml)可省,将其配置在applicationContext.xml中。 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"