所以我使用keycloak作为认证机制,通过修改login.ftl文件来自定义登录页面。到现在为止还挺好。我正在我的 login.ftl 中导入 template.ftl 文件 - 按照 keycloak 文档的指示 - 到目前为止一切顺利。在该 template.ftl 文件中 - 有一种访问错误消息的方法,如下所示
<#if displayMessage && message?has_content && (message.type != 'warning' || !isAppInitiatedAction??)>
<div class="alert alert-${message.type}">
<#if message.type = 'success'><span class="${properties.kcFeedbackSuccessIcon!}"></span></#if>
<#if message.type = 'warning'><span class="${properties.kcFeedbackWarningIcon!}"></span></#if>
<#if message.type = 'error'><span class="${properties.kcFeedbackErrorIcon!}"></span></#if>
<#if message.type = 'info'><span class="${properties.kcFeedbackInfoIcon!}"></span></#if>
<span class="kc-feedback-text">${kcSanitize(message.summary)?no_esc}</span>
</div>
</#if>
好的,不错!如果我不想处理该 template.ftl 文件中的错误消息 ui 怎么办?我在 login.ftl 页面上有一个表单 UI,我想在其中显示错误消息。如何将该消息传递到 login.ftl 文件或从 login.ftl 文件访问该错误消息?提前感谢您的任何指导。