Java–获取request中所有参数

这里取值后并放入了map

  1. Map<String, String> map = new HashMap<String, String>();
  2.         Enumeration enu=request.getParameterNames();
  3.         while(enu.hasMoreElements()){
  4.         String paraName=(String)enu.nextElement();
  5.         System.out.println(paraName+": "+request.getParameter(paraName));
  6.         map.put(paraName, request.getParameter(paraName));
  7.         }
腾讯云服务器安全可靠高性能,多种配置供您选择
avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: