获取request中的查询参数

//获取request中的查询参数
    public static Map<String, Object> getRequestParamsByMap(HttpServletRequest request) {
        Map<String,Object> qmap=new HashMap<String,Object>();
        Enumeration<String> paraNames = request.getParameterNames();
        while(paraNames.hasMoreElements()) {
            String paraName = paraNames.nextElement();
            String paraValue = request.getParameter(paraName);
            if(!S.isNull(paraValue)) {
                if(paraName.indexOf("Time")!=-1||paraName.indexOf("Time")!=-1) {
                    qmap.put(paraName,request.getParameter(paraName));
                }else {
                    qmap.put(paraName,"%"+request.getParameter(paraName)+"%");
                }
                
            }
        }
        return qmap;
    }

 

posted @ 2015-01-15 18:43  剑握在手  阅读(623)  评论(0编辑  收藏  举报
返回顶部↑