为通知传递参数创建带参数的通知
//有参数
/*public void beforee(int number){
System.out.println("number:" + number);
}*/
创建带参数的方法
//有参数
public void perform(int number) {
System.out.println("perform2");
}
切面和切点的配置,在 xml 中使用 and 连接 args 参数
<aop:config>
<aop:aspect ref="aopConfug">
<aop:pointcut expression="execution(** com.tidas.spring.fourth.aopxml.AopXml.*(int)) and args(number)" id="aopxmll"/>
<aop:before pointcut-ref = "aopxmll" method="beforee"/>
</aop:aspect>
</aop:config>
通过切面为 Java 引入新的功能
来源: https://www.cnblogs.com/tidas809/p/8320367.html