Compared with schema-based, aspectJ is a lot more troublesome to transfer parameters
There is a pre-notification below, the demo1 method has two parameters: int and string
applicationContext.xml
The parameters in args (int id1, String name1) come from the pointcut method (int id, String name), and the number, type and order of the parameters must be consistent
The parameter after args, the parameter type and parameter name of arg-names (int id1, String name1) must be consistent
The parameters in advice (int id2, String name2) must be consistent with the number, type and order of arg-names parameters
<beanid="myadvice"class="cn.wit.advice.MyAdvice"></bean><aop:config><aop:aspectref="myadvice"><aop:pointcutid="mypoint"expression="execution(* cn.wit.test.Demo.Demo1(int,String)) and args(id1,name1)"/><aop:beforemethod="mybefore"pointcut-ref="mypoint"arg-names="id1,name1"/></aop:aspect></aop:config><beanid="demo"class="cn.wit.test.Demo"></bean>