×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Nhan Tran
Added: Aug 7, 2021 1:05 PM
Views: 3654
Tags: no tags
  1. HttpServletRequest req = (HttpServletRequest) request;
  2.         Enumeration<String> params = req.getParameterNames();
  3.         while (params.hasMoreElements()) {
  4.             String name = params.nextElement();
  5.             String value = request.getParameter(name);
  6.             log.info(req.getRemoteAddr() + "::Request Params::{" + name + "=" + value + "}");
  7.         }
  8.  
  9.         Cookie[] cookies = req.getCookies();
  10.         if (cookies != null) {
  11.             for (Cookie cookie : cookies) {
  12.                 log.info(req.getRemoteAddr() + "::Cookie::{" + cookie.getName() + "," + cookie.getValue() + "}");
  13.             }
  14.         }
  15.         // pass the request along the filter chain
  16.         chain.doFilter(request, response);