1. lib目录导入jar包
2. mybatis整合
1. 编写mybatis核心配置文件 sqlMapConfig.xml
2. 编写jdbc.properties 连接参数配置文件
3. 编写 applicationContext-dao.xml ;
1. 导入 jdbc.properties;
2. 配置连接池;
3. 配置sqlSessionFactory;
4. dao接口扫描,用户创建dao代理对象;
3. springmvc整合
1. 编写 Springmvc 核心配置文件 springmvc.xml
1. 配置 @Controller 注解扫描
2. 配置 映射器,适配器,用注解驱动替代
<!-- 配置处理器映射器 适配器 -->
<mvc:annotation-driven />
3. 配置 视图解析器 InternalResourceViewResolver
2. web.xml配置:
1. 配置 前置处理器 DispatcherServlet
2. post乱码处理:配置过滤器:
4. spring配置:
1. 服务器启动监听 ContextLoaderListener --->触发spring开启;
要在监听器之前配置 全局参数:contextConfigLocation 指定Spring配置文件位置;
SSM整合流程
最新推荐文章于 2024-06-12 22:45:12 发布