Browse Source

ActionRepoter 支持扩展

James 5 years ago
parent
commit
fa6f03f335
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/main/java/com/jfinal/core/ActionHandler.java

+ 5 - 3
src/main/java/com/jfinal/core/ActionHandler.java

@@ -35,6 +35,7 @@ public class ActionHandler extends Handler {
 	protected boolean devMode;
 	protected ActionMapping actionMapping;
 	protected ControllerFactory controllerFactory;
+	protected ActionReporter actionReporter;
 	protected static final RenderManager renderManager = RenderManager.me();
 	private static final Log log = Log.getLog(ActionHandler.class);
 	
@@ -42,6 +43,7 @@ public class ActionHandler extends Handler {
 		this.actionMapping = actionMapping;
 		this.devMode = constants.getDevMode();
 		this.controllerFactory = constants.getControllerFactory();
+		this.actionReporter = constants.getActionReporter();
 	}
 	
 	/**
@@ -82,11 +84,11 @@ public class ActionHandler extends Handler {
 			controller._init_(action, request, response, urlPara[0]);
 			
 			if (devMode) {
-				if (ActionReporter.isReportAfterInvocation(request)) {
+				if (actionReporter.isReportAfterInvocation(request)) {
 					new Invocation(action, controller).invoke();
-					ActionReporter.report(target, controller, action);
+					actionReporter.report(target, controller, action);
 				} else {
-					ActionReporter.report(target, controller, action);
+					actionReporter.report(target, controller, action);
 					new Invocation(action, controller).invoke();
 				}
 			}