【发布时间】:2013-03-27 13:50:52
【问题描述】:
我正在使用 Spring AOP 并且有以下方面:
@Aspect
public class LoggingAspect {
@Before("execution(* com.mkyong.customer.bo.CustomerBo.addCustomer(..))")
public void logBefore(JoinPoint joinPoint) {
System.out.println("logBefore() is running!");
System.out.println("hijacked : " + joinPoint.getSignature().getName());
System.out.println("******");
}
}
上面的切面拦截addCustomer方法的执行。 addCustomer 方法将字符串作为输入。
但我需要在logBefore 方法中记录传递给addCustomer 方法的输入。
有可能吗?
【问题讨论】:
-
addCustomer(..)的方法签名是什么?