如何获得request中的全部参数
https://blog.csdn.net/tanjunjie621/article/details/12574175
代码固定形式如下
private void showParams(HttpServletRequest request) {
Map map = new HashMap();
Enumeration paramNames = request.getParameterNames();
while (paramNames.hasMoreElements()) {
String paramName = (String) paramNames.nextElement();
String[] paramValues = request.getParameterValues(paramName);
if (paramValues.length == 1) {
String paramValue = paramValues[0];
if (paramValue.length() != 0) {
map.put(paramName, paramValue);
}
}
}
Set<Map.Entry<String, String>> set = map.entrySet();
System.out.println("------------------------------");
for (Map.Entry entry : set) {
System.out.println(entry.getKey() + ":" + entry.getValue());
}
System.out.println("------------------------------");
}