编程语言
首页 > 编程语言> > java打印request请求参数所有信息

java打印request请求参数所有信息

作者:互联网

Map<String, String> map = new HashMap<String, String>();
Enumeration paramNames = request.getParameterNames();
while(paramNames.hasMoreElements()) {
String paramName = (String) paramNames.nextElement();
String[] paramValues = request.getParameterValues(paramName);
if (paramValues.length == 1) {
if ( paramValues[0].length() != 0) {
map.put(paramName, paramValues[0]);
}
}
}
System.out.println("----------------------------------------------"+map+"---------------------------------------");

标签:map,paramNames,java,String,打印,request,paramValues,paramName
来源: https://www.cnblogs.com/jingwei129/p/16284873.html