我明白了: public Map getParameterMap() Returns a java.util.Map of the parameters of this request. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data. Returns: an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.
Set set = map.keySet();
Iterator it = set.iterator();
String parametername = "";
while (it.hasNext()) {
parametername = (String) it.next();
String values[] = request.getParameterValues(parametername);
out.println("按钮的名称: " + parametername);
out.println("<ul>");
for (int i = 0; i < values.length; i++) {
out.println("<li>" + values[i] + "<li>");
}
out.println("</ul>");
}这样可以吧?
Enumeration eNames = request.getParameterNames();
String key = null;
String value = null;
while (eNames.hasMoreElements()) {
key = (String) eNames.nextElement();
value = request.getParameter(key);
if (value == null || value.equals("") || value.equals("null")) {
value = "";
} else {
try {
// System.out.println(java.net.URLDecoder.decode(value, "UTF-8"));
value = URLDecoder.decode(value, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
key = key.toLowerCase();
// System.out.println("Key="+key+" value="+value);
m.put(key, value);
}
public Map getParameterMap()
Returns a java.util.Map of the parameters of this request. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data. Returns:
an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.