有人知道around通知哪里參數是怎樣匹配的嗎?
有人知道around通知哪里參數是怎樣匹配的嗎?
<aop:around method="aroundInit" pointcut="execution(* springC04.AspectBiz.Init(String,int)) and args(bizName,times)"/>
參數名一定要和aroundInit的匹配,而aroundInit的參數類型要是string和int。具體是怎樣的?????有人知道around通知哪里參數是怎樣匹配的嗎?
<aop:around method="aroundInit" pointcut="execution(* springC04.AspectBiz.Init(String,int)) and args(bizName,times)"/>
參數名一定要和aroundInit的匹配,而aroundInit的參數類型要是string和int。具體是怎樣的?????2017-07-05
舉報
2017-08-20
我試了一下,當兩個類型都是String時,你把args(bizName,times) 換成args(times,bizName),aroundInit方法里面的輸出就會返回來,但是類型還是String和Int時,你用args(times,bizName),也就是參數返回來的話,aroundInit就不會執行了。
2017-08-20
在老師的測試代碼里不有這行么
2017-07-05
。。你這個不是寫出來了么, 就是?method="aroundInit" 對應?aroundInit這個方法,要在這個方法通知。pointcut 這個是切入點規則,?Init(String,int)) and args(bizName,times) 是匹配方法名,參數類型和參數名。