添加參數

master
jiahuiwen 2021-10-27 14:10:38 +08:00
parent 7e58454a6f
commit e129b5d745
1 changed files with 22 additions and 21 deletions

View File

@ -37,6 +37,7 @@ public class JsonUtil {
public Gson getGson() {
return gson;
}
public HashMap<String, String> getParameterMap2(HttpServletRequest request) throws IOException {
HashMap<String, String> map = new HashMap();
Enumeration paramNames = request.getParameterNames();
@ -72,10 +73,7 @@ public class JsonUtil {
HashMap<String, String> map = new HashMap();
Enumeration paramNames = request.getParameterNames();
while (paramNames.hasMoreElements()) {
String paramName = (String) paramNames.nextElement();
JSONObject data = new JSONObject(paramName);
Set<String> strings = data.keySet();
for (String string : strings) {
String string = (String) paramNames.nextElement();
LOGGER.info("getParameterMapYX param {}", string);
string = string.replace("{", "");
string = string.replace("}", "");
@ -83,8 +81,10 @@ public class JsonUtil {
String[] split = string.split(",");
for (String s : split) {
String[] split1 = s.split(":");
map.put(split1[0].replace("\"", ""), split1[1].replace("\"", ""));
}
String key = split1[0].replace("\"", "");
String value = split1[1].replace("\"", "");
map.put(key, value);
LOGGER.info("getParameterMapYX =================> key={} value={}", key, value);
}
}
return map;
@ -119,6 +119,7 @@ public class JsonUtil {
/**
*
*
* @param specifiedDay
* @return
*/