@Aspect 拦截器相关

执行时机:在HandlerInterceptor


@Pointcut("execution(* com.jbs.oms.aggreg.web.controller.*.*.*(..))")
private void excudeController() {
}

@Before("excudeController()")
public void before(JoinPoint joinPoint) {
  //通过joinPoint可以获取request相关参数:
  Object[] args = joinPoint.getArgs();
  
  //获取当前方法对象:
  MethodJoinPoint point = (MethodJoinPoint)joinPoint;
Signature signature = point.getSignature();
  Method method = signature.getMethod();
  
  //获取当前类:
  joinPoint.getTarget().getClass();
  
}

猜你喜欢

转载自www.cnblogs.com/qlsty/p/12147118.html
今日推荐