浏览代码

controllerKey 改为 controllerPath

James 5 年之前
父节点
当前提交
7ecac7b94b

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

@@ -189,7 +189,7 @@ public class Invocation {
 	
 	/**
 	 * Return the action key.
-	 * actionKey = controllerKey + methodName
+	 * actionKey = controllerPath + methodName
 	 */
 	public String getActionKey() {
 		if (action == null)

+ 1 - 1
src/main/java/com/jfinal/aop/InvocationWrapper.java

@@ -119,7 +119,7 @@ class InvocationWrapper extends Invocation {
 	
 	/**
 	 * Return the action key.
-	 * actionKey = controllerKey + methodName
+	 * actionKey = controllerPath + methodName
 	 */
 	@Override
 	public String getActionKey() {

+ 10 - 10
src/main/java/com/jfinal/core/ActionMapping.java

@@ -79,7 +79,7 @@ public class ActionMapping {
 				}
 				
 				Interceptor[] actionInters = interMan.buildControllerActionInterceptor(routes.getInterceptors(), controllerInters, controllerClass, method);
-				String controllerKey = route.getControllerPath();
+				String controllerPath = route.getControllerPath();
 				
 				String methodName = method.getName();
 				ActionKey ak = method.getAnnotation(ActionKey.class);
@@ -93,13 +93,13 @@ public class ActionMapping {
 						actionKey = SLASH + actionKey;
 				}
 				else if (methodName.equals("index")) {
-					actionKey = controllerKey;
+					actionKey = controllerPath;
 				}
 				else {
-					actionKey = controllerKey.equals(SLASH) ? SLASH + methodName : controllerKey + SLASH + methodName;
+					actionKey = controllerPath.equals(SLASH) ? SLASH + methodName : controllerPath + SLASH + methodName;
 				}
 				
-				Action action = new Action(controllerKey, actionKey, controllerClass, method, methodName, actionInters, route.getFinalViewPath(routes.getBaseViewPath()));
+				Action action = new Action(controllerPath, actionKey, controllerClass, method, methodName, actionInters, route.getFinalViewPath(routes.getBaseViewPath()));
 				if (mapping.put(actionKey, action) != null) {
 					throw new RuntimeException(buildMsg(actionKey, controllerClass, method));
 				}
@@ -108,7 +108,7 @@ public class ActionMapping {
 		}
 		routes.clear();
 		
-		// support url = controllerKey + urlParas with "/" of controllerKey
+		// support url = controllerPath + urlParas with "/" of controllerPath
 		Action action = mapping.get("/");
 		if (action != null) {
 			mapping.put("", action);
@@ -128,11 +128,11 @@ public class ActionMapping {
 	
 	/**
 	 * Support four types of url
-	 * 1: http://abc.com/controllerKey                 ---> 00
-	 * 2: http://abc.com/controllerKey/para            ---> 01
-	 * 3: http://abc.com/controllerKey/method          ---> 10
-	 * 4: http://abc.com/controllerKey/method/para     ---> 11
-	 * The controllerKey can also contains "/"
+	 * 1: http://abc.com/controllerPath                 ---> 00
+	 * 2: http://abc.com/controllerPath/para            ---> 01
+	 * 3: http://abc.com/controllerPath/method          ---> 10
+	 * 4: http://abc.com/controllerPath/method/para     ---> 11
+	 * The controllerPath can also contains "/"
 	 * Example: http://abc.com/uvw/xyz/method/para
 	 */
 	public Action getAction(String url, String[] urlPara) {