}
private void redirectToView(String view, HttpServletRequest request, HttpServletResponse response, ModelAndView modelAndView) throws IOException {
// Creating Ajax redirect action:
AjaxResponse ajaxResponse = new AjaxResponseImpl();
AjaxAction ajaxAction = new RedirectAction(new StringBuilder(request.getContextPath()).append(view).toString(), modelAndView);
ajaxResponse.addAction(ajaxAction);
// Need to clear the ModelAndView because we are handling the response by ourselves:
modelAndView.clear();
AjaxResponseSender.sendResponse(response, ajaxResponse);
}