由于采用的是SpringMVC、 MyBatis,故统一采用了标注来声明Service、Controller
由于服务器启动时的加载配置文件的顺序为web.xml—root-context.xml(Spring的配置文件)—servlet-context.xml(SpringMVC的配置文件),由于root-context.xml配置文件中Controller会先进行扫描装配
但是此时service还没有进行事务增强处理,得到的将是原样的Service(没有经过事务加强处理,故而没有事务处理能力),所以我们必须在root-context.xml中不扫描Controller!
通常我们使用mybatis会让自己的dao继承sqlsessiondaosupport,那么sqlsessiondaosupport是如何运作的呢,下面是sqlsessiondaosupport的源代码
/*
* copyright 2010 the mybatis team
*
* licensed under the apache license, version 2.0 (the "license");
* you may not use this file except in compliance with the license.
* you may obtain a copy of the license at
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....