spring + springMVC + mybatis 事务无效

来源:互联网 发布:mac 系统优化 编辑:程序博客网 时间:2024/06/06 12:47

三个框架在集成过程中,spring和spring mvc两个框架都都会通过<context:component-scan> 扫描,一个service会被扫描两次,造成了事务无效。

完善方法,在springMVC的配置文件中<context:component-scan>标签下加入

   <context:exclude-filtertype="annotation"expression="org.springframework.stereotype.Service"/>