victory的博客

长安一片月,万户捣衣声

0%

SSM | SSM项目搭建

SSM整合步骤:

1.导入jar包
spring:
springMVC:
mybatis:
第三方支持:log4j,pageHelper,AspectJ,jackson,jstl

2.搭建springMVC
(1)web.xml
CharacterEncodingFilter:filter
HiddenHttpMethodFilter:filter
DispatcherServlet:servlet
(2)springMVC.xml
扫描控制层组件:context:component-scan
视图解析器:InternalResourceViewResolver
Default Servlet:mvc:default-servlet-handler/
MVC驱动:<mvc:annotation-driven />
可选:MultipartResolver,拦截器

3.整合springMVC和spring
(1)web.xml
ContextLoaderListener:listener
context-param
(2)spring.xml
扫描组件(排除控制层)
4.搭建mybatis
核心配置文件mybatis-config.xml
mapper接口和mapper映射文件
5.spring整合mybatis
spring.xml:
properties文件的引入
DataSource数据源的配置:xxxDataSource
事务管理器:DataSourceTransactionManager
开启事务驱动:tx:annotation-driven
SqlSessionFactoryBean:管理SqlSession
MypperScannerConfigurer:自动生成Mapper接口的代理实现类
6.REST CRUD
查询+分页
修改(form)
项目目录