request获取请求参数
作者:互联网
/** * 方式1 */ Enumeration<?> enu=request.getParameterNames(); while(enu.hasMoreElements()){ String paraName=(String)enu.nextElement(); System.out.println(paraName+": "+request.getParameter(paraName)); } /** * 方式2 */ Map<String,String[]> map = request.getParameterMap(); for (Map.Entry<String, String[]> entry : map.entrySet()) { String kv = entry.getKey() + ":"+Arrays.toString(entry.getValue())+";"; System.out.println("kv:"+kv); }
标签:请求,request,String,参数,enu,entry,kv,paraName 来源: https://www.cnblogs.com/goatherd/p/11060089.html