/**
* <获取参数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中
最新推荐文章于 2021-09-29 09:15:42 发布