spring aop @AfterThrowing用法

@Around用法

    @Around(value = "pointcut()")
    public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
    
return joinPoint.proceed();
    }

@AfterThrowing用法

//pointcut()为注册的切入点方法
    @AfterThrowing(pointcut = "pointcut()", throwing = "ex")
    public void afterThrow(JoinPoint joinPoint, Exception ex) {
        String name = joinPoint.getSignature().getName();
        log.info(name + "异常:" + "	" + ex.getMessage());
原文地址:https://www.cnblogs.com/wulm/p/14385732.html