这个问题我真是百思不得其解啊!
<?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>
2
收起
正在回答
1回答

如图所示,把value改成ref。
这里是要引用这个orderServiceTarget
如果我的回答解决了你的疑惑,请采纳!祝学习愉快!
SSM主流框架入门与综合项目实战2018版
- 参与学习 人
- 提交作业 205 份
- 解答问题 4317 个
Java中非常实用的SSM整合开发内容,从Spring开始,到MyBaits的进阶内容,再到SpringMVC的应用,最后是SSM整合开发案例,逐步深入,助你成长为一名Java工程师!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星