springmvc mybatis,注解事务的使用

来源:互联网 发布:2017流行网络歌曲500首 编辑:程序博客网 时间:2024/05/18 03:16

 两个XML配置中,需要把扫描的类区分出来。

 

spring-mybatis.xml(application.xml):

 

 <!-- 自动扫描 -->      <context:component-scan base-package="com.maiken" >    <!-- 父容器不加载 action -->    <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />    </context:component-scan>

 

spring-mvc.xml

<!-- 自动扫描该包 -->      <context:component-scan base-package="com.maiken" >    <!-- 子容器不加载服务层  -->    <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" />    </context:component-scan>