java拦截器与过滤器打印请求url与参数

 

 

 

        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
        HttpServletResponse httpServletResponse = (HttpServletResponse) response;
        
        //请求参数打印
        LOGGER.info("uri: " + httpServletRequest.getRequestURI());
        Map map = request.getParameterMap();
        if (map != null && !map.isEmpty()) {
            Set<String> keySet = map.keySet();
            for (String key : keySet) {               
                    String[] values = (String[]) map.get(key);
                    for (String value : values) {
                            LOGGER.info("> " + key + "=" + value);
                    }              
            }
        }

 

posted @ 2017-11-03 10:44  这个名字想了很久~  阅读(7474)  评论(0编辑  收藏  举报