Store all parameters in the request in a custom 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;
    }

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326299685&siteId=291194637