摘要: 1.整合思路 Dao层: 1、SqlMapConfig.xml,空文件即可,但是需要文件头。 2、applicationContext-dao.xml a) 数据库连接池 b) SqlSessionFactory对象,需要spring和mybatis整合包下的。 c) 配置mapper文件扫描器。 阅读全文
posted @ 2018-10-30 16:47 X凯 阅读(241) 评论(0) 推荐(0)
摘要: 1.组件扫描器 使用组件扫描器省去在spring容器配置每个Controller类的繁琐。 使用<context:component-scan>自动扫描标记@Controller的控制器类, 在springmvc.xml配置文件中配置如下: 1.2 注解映射器和适配器 1.2.1. 配置处理器映射器 阅读全文
posted @ 2018-10-30 15:47 X凯 阅读(1213) 评论(0) 推荐(0)