学习ssm框架
一、什么是ssm框架
SSM全称是Spring+SpringMVC+MyBatis。
SSM框架集由Spring、MyBatis两个开源框架整合而成(SpringMVC是Spring中的部分内容)。常作为数据源较简单的web项目的框架。
1、Spring
Spring MVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面。Spring MVC 分离了控制器、模型对象、分派器以及处理程序对象的角色,这种分离让它们更容易进行定制
2、SpringMVC
SpringMVC在项目中拦截用户请求,它的核心Servlet即DispatcherServlet承担中介或是前台这样的职责,将用户请求通过HandlerMapping去匹配Controller,Controller就是具体对应请求所执行的操作。SpringMVC相当于SSH框架中struts。
SpringMVC的工作原理

3、mybatis
mybatis是对jdbc的封装,它让数据库底层操作变的透明。
mybatis的操作都是围绕一个sqlSessionFactory实例展开的。mybatis通过配置文件关联到各实体类的Mapper文件,Mapper文件中配置了每个类对数据库所需进行的sql语句映射。在每次与数据库交互时,通过sqlSessionFactory拿到一个sqlSession,再执行sql命令。

二.SSM框架的搭建(我使用的开发工具是idea 大家可以去下载)
一.创建Maven项目 (版本不同,但操作方式相同)
1.打开idea 点击 Create new prigect project

2.File -> New project,进入创建项目窗口。(SDK大家可以去网上下载)
(1点击maven
(2)勾选Create from archetype
(3)选择** maven-archetype-webapp**
(4)点击Next

3.输入GroupId和Artifactld,点击Next
GroupId:com.(一般填公司名,没有可以姓名缩写)
Artifactld:项目的名称

4.第一个是maven文件的位置
第二个是maven的setting文件
第三个是你建项目里面需要下载的其他文件放在哪个位置
点击Next

5.next

6.第一次创建都有点慢的 当出现下面那一现象就是创建成功

未完待续