@test的时候,配置的spring @transaction一切正常,但用浏览器访问的时候发现@transaction失效。
//一般用在application.xml
<context:component-scan base-package="org.tangxiao">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
</context:component-scan>
//一般用在spring-mvc.xml
<context:component-scan base-package="org.tangxiao">
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Service" />
</context:component-scan>