public static ModelAndView toModelAndView(final HttpStatus status, final String viewName) {
        val mv = new ModelAndView();
        mv.setStatus(HttpStatusCode.valueOf(status.value()));
        mv.setViewName(viewName);
        return mv;
    }
To model and view.

@param status   the status
@param viewName the view name
@return the model and view
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java