java 获取request中的参数,并将所有参数封装成map 工具le
2016-09-22 15:30
477 查看
public static Map getRequestParamMap(HttpServletRequest request) { Map map = new HashMap(); //得到枚举类型的参数名称,参数名称若有重复的只能得到第一个 Enumeration enums = request.getParameterNames(); while (enums.hasMoreElements()) { String paramName = (String) enums.nextElement(); String paramValue = request.getParameter(paramName); //形成键值对应的map map.put(paramName, paramValue); } return map; }
使用:Map paramMap=RequestUtils.getRequestParamMap(request);
相关文章推荐
- 8623错误:The query processor ran out of internal resources and could not pro
- 8623错误:The query processor ran out of internal resources and could not pro 推荐
- UIBUTTON titlelabel.text 不显示
- Vue.js 实践笔记
- 百度编辑器(UEditor),设置访问前缀。
- Android-Handler 总结(Handler 的使用 ,Looper , MessageQueue , HandlerThread )
- dojo/store/Memory 和 SimpleQueryEngine 解读 (非常简单的存储器管理工具 和 非常简单的查询引擎)
- UE4 三维点击事件
- 21. Upgrade-Insecure-Requests: 1
- Hello Guice
- Android UI设计--ListView的页脚(footer)的使用
- LayoutInflater和MenuInflater用法
- Android高手进阶教程(六)之----Android 中MenuInflater的使用(布局定义菜单)!
- APUE_chapter4 文件和目录 part2
- 获得用户安卓设备的唯一编号
- google-gson 使用及GsonBuilder设置
- confluent 对kafka格式化数据的处理
- UIScrollView如何判断是向右滚动还是向左滚动
- jsp Request获取url信息的各种方法
- easyUI icon中文命名图片无法在浏览器中访问处理方法