将request中的所有参数存放到自定义的map中
生活随笔
收集整理的這篇文章主要介紹了
将request中的所有参数存放到自定义的map中
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/*** <獲取參數map>* * @return 參數map* @throws Exception */protected Map<String, Object> getParameterMap(HttpServletRequest request) throws Exception {Map<String, Object> resultMap = new HashMap<String, Object>();Map<String, String[]> tempMap = request.getParameterMap();Set<String> keys = tempMap.keySet();for (String key : keys) {byte source [] = request.getParameter(key).getBytes("iso8859-1");String modelname = new String (source,"UTF-8");resultMap.put(key,modelname);}return resultMap;}
總結
以上是生活随笔為你收集整理的将request中的所有参数存放到自定义的map中的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 趣闻进制转换
- 下一篇: js获取html代码中所有图片地址