spring transaction 失效问题

来源:互联网 发布:特价专场首页淘宝优站 编辑:程序博客网 时间:2024/06/08 11:35

@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>

0 0
原创粉丝点击