title: How can we get and set response body in Spring Boot Filter
body: <p>I have a Spring MVC application which return ResponseEntity and clientResponse object as response body</p>
  <pre><code>@RestController
  public class XxxController {
  
      public void ResponseEntity(ClientRequest clientRequest) {
           ...
           return ResponseEntity.ok(clientResponse);
      }
  }
  </code></pre>
  <p>But how can we get the clientResponse object or set a new Response body in Spring Boot Filter?</p>
  <pre><code>@Component
  public class MyClassFilter implements Filter {
  
  
      @Override
      public void doFilter( HttpServletRequest req,  HttpServletResponse res, FilterChain chain) throws IOException, ServletException {
   
      }
  
      @Override
      public void destroy() {}
  
      @Override
      public void init(FilterConfig arg0) throws ServletException {}
  
  }
  </code></pre>