public static HttpServletResponse getHttpServletResponseFromExternalWebflowContext() {
        val servletExternalContext = ExternalContextHolder.getExternalContext();
        if (servletExternalContext != null) {
            return (HttpServletResponse) servletExternalContext.getNativeResponse();
        }
        return null;
    }
Gets the http servlet response from the current servlet context.

@return the http servlet response
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java