遇到 AOP 环绕通知报错 “return value from advice does not match primitive return type for: public boolean” 百度后搜到是因为 环绕通知的返回值类型要为 object ,而出问题的代码返回值类型 写成了void. 参考:AOP 报错 return value from advice does not match primitive return type for: public boolean 那么为什么其他
在前置通知和后置通知的基础上加上返回通知&异常通知&环绕通知 代码: package com.cn.spring.aop.impl; //加减乘除的接口类 public interface ArithmeticCalculator { int add(int i, int j); int sub(int i, int j); int mul(int i, int j); int div(int i, int j); } package com.cn.spring.aop.impl; imp