public static void addWarningMessageToContext(final MessageContext context, final MessageDescriptor warning) {
        val builder = new MessageBuilder()
            .warning()
            .code(warning.getCode())
            .defaultText(warning.getDefaultMessage())
            .args((Object[]) warning.getParams());
        context.addMessage(builder.build());
    }
Add warning message to context.

@param context the context
@param warning the warning
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java