lang110 发表于 2016-11-26 08:32:37

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>
页: [1]
查看完整版本: springmvc mybatis,注解事务的使用