0
是否有人懂得「翻譯/覆蓋」春季安全$ {} SPRING_SECURITY_LAST_EXCEPTION.message到 JSF 的FacesMessage,以顯示它在PrimeFaces 號碼:咆哮組件?
有可能做到這一點與JavaScript代碼?
下面是一些代碼:
<h:form id="loginForm" prependId="false">
<p:panel id="panelLogin">
<h:panelGrid columns="2">
<h:outputLabel for="j_username" value="User" />
<p:inputText id="j_username" required="true" label="Username" name="j_username" />
<h:outputLabel for="j_password" value="Pwd" />
<p:password id="j_password" required="true" label="Password" />
</h:panelGrid>
<p:commandButton value="GO!" ajax="false"
onclick="document.loginForm.action='#{request.contextPath}/j_spring_security_check';document.loginForm.method='post';" />
</p:panel>
</h:form>
<!-- This works: -->
<c:if test="${not empty param.login_error}">
<h:outputText value="${SPRING_SECURITY_LAST_EXCEPTION.message}" />
</c:if>
<!-- Target component to show FacesMessages -->
<p:growl id="loginGrowl" />