Change scope of ModelAndView->sendHeaders() to make adaptation easier