JAVA Request获取所有请求参数

Map<String, String[]> params = request.getParameterMap();
String queryString = "";
for (String key : params.keySet()) {
    String[] values = params.get(key);
    for (int i = 0; i < values.length; i++) {
        String value = values[i];
        queryString += key + "=" + value + "&";
    }
}
queryString = queryString.substring(0, queryString.length() - 1);
System.out.println(queryString);

 

你可能感兴趣的:(request)