Enumeration和Map

Enumeration enu = request.getParameterNames();
while(enu.hasMoreElements()){
String paramName = (String)enu.nextElement();
}

------------------------------------------------------
------------------------------------------------------
Map<String, String[]> paramMap = request.getParameterMap();
Set<Map<String, String[]>> entries = paramMap.entrySet();
for(Iterator<Map<String, String[]>> it = entries.iterator(); it.hasNext(); ){
  Map<String, String[]>  entry = it.next();
  String paramName = entry.getKey();
  String[] paramValue = entry.getValue();
}

猜你喜欢

转载自forlab.iteye.com/blog/1439478