springmvc mybatis,注解事务的使用

 两个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>  

猜你喜欢

转载自hongmin118.iteye.com/blog/2261778