ソースを参照

在创建 Invocation 时生成 args 值,便于在拦截器使用 getArgs() 获取

James 8 年 前
コミット
8b0f2c9bc9
1 ファイル変更1 行追加3 行削除
  1. 1 3
      src/main/java/com/jfinal/aop/Invocation.java

+ 1 - 3
src/main/java/com/jfinal/aop/Invocation.java

@@ -50,7 +50,7 @@ public class Invocation {
 		this.action = action;
 		this.inters = action.getInterceptors();
 		this.target = controller;
-		// this.args = action.getParameterGetter().get(controller);
+		this.args = action.getParameterGetter().get(controller);
 	}
 	
 	public Invocation(Object target, Method method, Object[] args, MethodProxy methodProxy, Interceptor[] inters) {
@@ -70,8 +70,6 @@ public class Invocation {
 			try {
 				// Invoke the action
 				if (action != null) {
-					// 延迟对 args 的获取,以便在拦截器中能让 inv.getController().setHttpServletRequest(...) 更好工作
-					args = action.getParameterGetter().get((Controller)target);
 					returnValue = action.getMethod().invoke(target, args);
 				}
 				// Invoke the method