I realy get dangle. This code works fine:
@Before("execution(* *.runi(..))")
public void perform()
{
sysout("hello");
}
but this get exception:
@Pointcut("execution(* *.runi(..))")
public void perform()
{
}
@Before("perform()")
public void singerReport(Name name)
{
sysout("hello");
}
exception:
Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut
You can use somefing like:
@Pointcut("execution(* *.runi(com.yourproject.Name)) && args(name)")
public void perform(Name name){}
@Before("perform(com.yourproject.Name) && args(name)")
public void singerReport(Name name)
{
sysout("hello");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With