
赏金花园豆: 5 [待解决的问题] 
最近研究Spring知识时,在使用“ xml +注释”配置AOP和事务时,<aop: Aspectj-autoproxy />和


<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" 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 http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd "> <context:component-scan base-package="yt"></context:component-scan>
<!-- 下面两个任意注释一个都能正常使用,2个一起出现的时候事务管理就不起作用了 --> <aop:aspectj-autoproxy/> <tx:annotation-driven transaction-manager="transactionManager"/> </beans>


请感谢您的帮助,非常感谢

多莉击败艾||菜豆: 197
在以下时间有疑问: 2018-08-23 17:52

后来,我发现在5种通知类型中,可以使用前置通知,后期通知,异常通知和最终通知注释. 仅当且仅当在通知周围配置了注释时,才使用上面的xml. 交易配置在配置期间不起作用
– 1年前杜古小败ai
使用“ Ctrl + Enter”进行快速提交,注释支持Markdown语法的一部分: [link]()_italic_ **粗体**`代码`.
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-152332-1.html
我也是