这个问题我真是百思不得其解啊!

这个问题我真是百思不得其解啊!

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd">

    <!--引入数据源-->
    <import resource="classpath:spring-dao.xml"/>
    <!--声明事务的管理类-->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <!--配置dateSource-->
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <!--声明目标拦截对象-->
    <bean id="ordersServiceTarget" class="com.imooc.os.service.impl3.OrdersServiceImpl"></bean>
    <!--设置事务的拦截器-->
    <bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
        <!--设置事务的管理类-->
        <property name="transactionManager" ref="transactionManager"/>
        <!--设置事务的属性-->
        <property name="transactionAttributes">
            <props>
                <prop key="*">PROPAGATION_REQUIRED</prop>
            </props>
        </property>
    </bean>
    <!--设置代理类工厂-->
    <bean id="ordersService" class="org.springframework.aop.framework.ProxyFactoryBean">
        <!--设置代理目标对象-->
        <property name="target" value="ordersServiceTarget"/>
        <!--设置拦截器-->
        <property name="interceptorNames">
            <list>
                <idref bean="transactionInterceptor"/>
            </list>
        </property>
    </bean>

</beans>


正在回答

登陆购买课程后可参与讨论,去登陆

1回答

http://img1.sycdn.imooc.com//climg/5c40638500015f7507120445.jpg

如图所示,把value改成ref。

这里是要引用这个orderServiceTarget

如果我的回答解决了你的疑惑,请采纳!祝学习愉快!

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
SSM主流框架入门与综合项目实战2018版
  • 参与学习           人
  • 提交作业       205    份
  • 解答问题       4317    个

Java中非常实用的SSM整合开发内容,从Spring开始,到MyBaits的进阶内容,再到SpringMVC的应用,最后是SSM整合开发案例,逐步深入,助你成长为一名Java工程师!

了解课程
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师