最新回答 / 慕沐4536427
好坑,我在
<context:component-scan base-package="com.imooc.aop.aspectj.*" />这个地方多写了一个.* 就导致aspect 没扫描上!!
2018-08-07
最赞回答 / 慕前端5122973
《spring实战》2.3中开头介绍到:你想要将第三方库中的组件装配到你的应用中,在这种情况下,是没有办法在它的类上添加@Component和@Autowired注解的,因此就不能使用自动化装配的方案了。
最赞回答 / 精慕门1546425
这个地方,老师应该讲错了。types-matching是用来匹配类型的,无关方法。在Spring官方文档中,“The value of the types-matching attribute is an AspectJ type pattern ”但是,AspectJ语言关于type pattern的介绍中,通配符方面,没有看到独立使用+加号的含义。。。。老师案例中,可以做两个测试:1、将(+)去掉,一样可以正常执行。2、如果匹配到方法,是会报错的。
2018-07-20
已采纳回答 / 精慕门1546425
Spring官方的说法是,在同一个切面内,同类型(前/后)的通知顺序是不确定的。因为通过反射确定类中生命(这句话的意思,我也不理解)。见官方文档说明(同时给出了排序的建议):When two pieces of advice defined in the same aspect both need to run at the same join point, the ordering is undefined (since there is no way to retrieve the declarati...
2018-07-03