三个框架在集成过程中,spring和spring mvc两个框架都都会通过<context:component-scan> 扫描,一个service会被扫描两次,造成了事务无效。
完善方法,在springMVC的配置文件中<context:component-scan>标签下加入
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" />
三个框架在集成过程中,spring和spring mvc两个框架都都会通过<context:component-scan> 扫描,一个service会被扫描两次,造成了事务无效。
完善方法,在springMVC的配置文件中<context:component-scan>标签下加入
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" />