且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

调用带注释的方法时,运行另一个函数

更新时间:2023-11-24 12:43:22

@Component
@Aspect
public class Mail {
    @After("execution (@com.yourdirectoryofyourcustomAnnotation.SendMail * *(..))")
    public void sendEmail(JointPoint jp){
        // it will send a mail after every method which tagged by your annotation
    }
}