private ModelAndView generateErrorView(final String code,
                                           final String description,
                                           final HttpServletRequest request,
                                           final WebApplicationService service) {
        val clientInfo = ClientInfoHolder.getClientInfo();
        val event = new CasServiceTicketValidationFailedEvent(this, code, description, service, clientInfo);
        getServiceValidateConfigurationContext().getApplicationContext().publishEvent(event);

        val modelAndView = serviceValidateConfigurationContext.getValidationViewFactory()
            .getModelAndView(request, false, service, getClass());
        modelAndView.addObject(CasViewConstants.MODEL_ATTRIBUTE_NAME_ERROR_CODE, StringEscapeUtils.escapeHtml4(code));
        modelAndView.addObject(CasViewConstants.MODEL_ATTRIBUTE_NAME_ERROR_DESCRIPTION, StringEscapeUtils.escapeHtml4(description));
        return modelAndView;
    }
Enforce ticket validation authorization for.

@param request   the request
@param service   the service
@param assertion the assertion
support/cas-server-support-validation-core/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java