title: How can I log the JSON response of Spring 3 controllers with @ResponseBody in a HandlerInterceptorAdapter?
body: <p>I have controllers that return JSON to the client. The controllers methods are marked using mvc annotation such as:</p>
  
  <pre><code>@RequestMapping("/delete.me")
  public @ResponseBody Map&lt;String, Object&gt; delete(HttpServletRequest request, @RequestParam("ids[]") Integer[] ids) {
  </code></pre>
  
  <p>Spring knows to return JSON since Jackson is on the class path and the client is requesting a JSON response. I would like to log the response of these requests and all other controllers. In the past I have used an interceptor to do this. However, I got the response body from the ModelAndView. How can I get the response body in the inteceptor now that I'm using @ResponseBody? Specifically, how can I get the response body in this method?</p>
  
  <pre><code>public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) {
  </code></pre>