<aop:around method="actionAround" pointcut-ref="rightfiltercut" expression="execution(* com.exdoit.action..push_*(..))" ></aop:around>
public Object actionAround(ProceedingJoinPoint joinPoint) throws Exception {
Object o = null;
if(成功){
o = joinPoint.proceed();
}else{
//其它处理方法
}
return o;
}
需要使用一个返回对象,如果要继续执行后面代理的方法.就让 返回的 o= joinPoint.proceed();如果要跳过代理的方法,就不执行 joinPoint.proceed();并返回 null ,或者也可以返回字符串
本文介绍了一种使用AOP(面向切面编程)来实现方法织入的技术。通过定义<aop:around>通知,可以围绕目标方法执行自定义逻辑。具体实现了actionAround方法,在该方法中通过判断条件决定是否调用joinPoint.proceed()来控制是否执行后续的目标方法。

175

被折叠的 条评论
为什么被折叠?



