Browse Source

添加 getInnerRequest()

James 3 years ago
parent
commit
0dc39ad085
1 changed files with 25 additions and 5 deletions
  1. 25 5
      src/main/java/com/jfinal/core/paragetter/JsonRequest.java

+ 25 - 5
src/main/java/com/jfinal/core/paragetter/JsonRequest.java

@@ -62,6 +62,20 @@ public class JsonRequest implements HttpServletRequest {
 		return jsonArray;
 	}
 	
+	/*public Map<String, Object> getJsonMap() {
+		return jsonObject;
+	}
+	public java.util.List<Object> getJsonList() {
+		return jsonArray;
+	}*/
+	
+	/**
+	 * 获取内部 HttpServletRequest 对象
+	 */
+	public HttpServletRequest getInnerRequest() {
+		return req;
+	}
+	
 	/**
 	 * 请求参数是否为 JSONObject 对象
 	 */
@@ -131,11 +145,22 @@ public class JsonRequest implements HttpServletRequest {
 		}
 	}
 	
+	/**
+	 * 该方法将触发 createParaMap(),框架内部应尽可能避免该事情发生,以优化性能
+	 */
 	@Override
 	public Map<String, String[]> getParameterMap() {
 		return getParaMap();
 	}
 	
+	/**
+	 * 该方法将触发 createParaMap(),框架内部应尽可能避免该事情发生,以优化性能
+	 */
+	@Override
+	public String[] getParameterValues(String name) {
+		return getParaMap().get(name);
+	}
+	
 	@Override
 	public Enumeration<String> getParameterNames() {
 		// return Collections.enumeration(getParaMap().keySet());
@@ -146,11 +171,6 @@ public class JsonRequest implements HttpServletRequest {
 		}
 	}
 	
-	@Override
-	public String[] getParameterValues(String name) {
-		return getParaMap().get(name);
-	}
-	
 	// ---------------------------------------------------------------
 	// 以下方法仅为对 req 对象的转调 -------------------------------------