java拦截器获取请求参数

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

复制代码

你可能感兴趣的:(springboot)