I have a Spring MVC application which return ResponseEntity and clientResponse object as response body
@RestController
public class XxxController {
public void ResponseEntity(ClientRequest clientRequest) {
...
return ResponseEntity.ok(clientResponse);
}
}
But how can we get the clientResponse object or set a new Response body in Spring Boot Filter?
@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 {}
}