title: How to implement ResponseBodyAdvice to all controllers?
body: <p>I have a requirement to edit my HttpResponse to add header value. I was searching for single point to implement it and found that <code>ResponseBodyadvice</code> would be helpful.</p>
  
  <p>But both methods That overrode in my new class was never called. Could you please tell if I have missed any configurations.</p>
  
  <pre><code>@ControllerAdvice
  public class EditResponseHeader implements ResponseBodyAdvice&lt;object&gt; {
  
  
  @Override
  public boolean supports(MethodParameter returnType,
          Class&lt;? extends HttpMessageConverter&lt;?&gt;&gt; converterType) {
  
     return true;
  }
  
  ....
  
  @Override
  public Object beforeBodyWrite(Object body, MethodParameter returnType,
          MediaType selectedContentType,
          Class&lt;? extends HttpMessageConverter&lt;?&gt;&gt; selectedConverterType,
          ServerHttpRequest request, ServerHttpResponse response) {
  
      ....
  
      return body;
  }
  
  }
  </code></pre>