为了账号安全,请及时绑定邮箱和手机立即绑定

环绕通知相关问题

这次after为何在after returning之前执行了呢

正在回答

1 回答

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 declaration order via reflection for javac-compiled classes). Consider collapsing such advice methods into one advice method per join point in each aspect class, or refactor the pieces of advice into separate aspect classes - which can be ordered at the aspect level.

0 回复 有任何疑惑可以回复我~
#1

精慕门1546425

确定类中生命=确定类中声明顺序
2018-07-20 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

环绕通知相关问题

我要回答 关注问题
微信客服

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

帮助反馈 APP下载

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

公众号

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