将request中的所有参数存放到自定义的map中

阅读更多
    /**
     * <获取参数map>
     * 
     * @return 参数map
     * @throws Exception 
     */
    protected Map getParameterMap(HttpServletRequest request) throws Exception {
        Map resultMap = new HashMap();
        Map tempMap = request.getParameterMap();
        Set 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中)