请大家帮帮忙

解决方案 »

  1.   

    不能在方法里面直接获得。自由在切入点方法的参数中传递
    public class Around implements MethodInterceptor   
    {   
        public Object invoke( MethodInvocation invocation)throws Throwable {   
            System.out.println("Round.invoke()");   
            System.out.println("Arguments:");   
            Object[] args = invocation.getArguments();   
    //这里可以获得方法的参数
            for(Object arg: args) {   
                System.out.println(arg.getClass().getName() + ": " + arg);   
            }   
            System.out.println("Method name:" + invocation.getMethod().getName());   
            //修改了目标方法返回值   
            return invocation.proceed() + " in Round.invoke()";   
        }   
    }