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); } } }
看完打开支付宝扫一扫领个红包吧!