generated from root/miduo_server
使用就解析参数方法
parent
523dd0110b
commit
e6ea389c7b
|
@ -36,7 +36,7 @@ public class HaoGameRechargeController {
|
|||
|
||||
@RequestMapping(value = "/haoGameCallback")
|
||||
public String haoGameCallback(HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMapOld(request);
|
||||
if (parameterMap.isEmpty()) {
|
||||
LOGGER.info("data is null");
|
||||
return "data is null";
|
||||
|
|
|
@ -70,6 +70,19 @@ public class JsonUtil {
|
|||
return map;
|
||||
}
|
||||
|
||||
public HashMap<String, String> getParameterMapOld(HttpServletRequest request) {
|
||||
HashMap<String, String> map = new HashMap();
|
||||
Enumeration paramNames = request.getParameterNames();
|
||||
while (paramNames.hasMoreElements()) {
|
||||
String paramName = (String) paramNames.nextElement();
|
||||
String[] paramValues = request.getParameterValues(paramName);
|
||||
String paramValue = paramValues[0];
|
||||
map.put(paramName, paramValue);
|
||||
LOGGER.info("parameter : " + paramName + "=" + paramValue);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static byte[] getRequestPostBytes(HttpServletRequest request)
|
||||
throws IOException {
|
||||
int contentLength = request.getContentLength();
|
||||
|
|
Loading…
Reference in New Issue