//核心业务逻辑类,保证业务逻辑类的功能单一,使用Spring Aop降低代码的侵入性 @Service public class Calc { //进行触发运算功能 public int div(int a, int b) { return a/b;))") public void logPointCut(){} //前置通知 @Before("logPointCut()") public void calcBefore(JoinPoint joinPoint){ String name=joinPoint.getSignature(). System.out.println("Log.AfterThrowing exec method "+name+",the args are"+ Arrays.asList(args)+",the Exception is "+e.getMessage());