You have a few options:
First, you can use the JoinPoint#getArgs()
method which returns an Object[]
containing all the arguments of the advised method. You might have to do some casting depending on what you want to do with them.
Second, you can use the args
pointcut expression like so:
// use '..' in the args expression if you have zero or more parameters at that point
@Before("execution(* com.mkyong.customer.bo.CustomerBo.addCustomer(..)) && args(yourString,..)")
then your method can instead be defined as
public void logBefore(JoinPoint joinPoint, String yourString)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…