Primefaces密码匹配未处理的消息

时间:2013-05-14 02:52:12

标签: primefaces passwords match

我正在尝试使用Primefaces 3.5密码匹配工作,并且我一直收到错误消息“有一些未处理的FacesMessages”,并且没有按预期显示正确的消息。

我已经创建了一个非常简单的页面,并且从展示中复制了“n”,试图消除所有其他可能的原因,但问题仍然存在。这是一个非常简单的页面:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
<h:head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
    <title>Primefaces Password Match Test</title>
    <link type="text/css" rel="stylesheet" href="#{facesContext.externalContext.requestContextPath}/css/custom.css" />
</h:head>
<h:body>
    <h:form id="form"> 
        <p:panel header="Match Mode">  
            <p:messages id="messages" showDetail="true" autoUpdate="true"/>
            <h:panelGrid columns="2" id="matchGrid">                     
                <h:outputLabel for="pwd1" value="Password 1: *" />  
                <p:password id="pwd1" value="#{passwordBean.password5}" match="pwd2" label="Password 1" required="true"/>
                <h:outputLabel for="pwd2" value="Password 2: *" />  
                <p:password id="pwd2" value="#{passwordBean.password5}" label="Password 2" required="true"/>  
            </h:panelGrid> 
            <p:commandButton id="saveButton" update="matchGrid" value="Save" />  
        </p:panel>  
    </h:form> 
</h:body>
</html>

我正在使用的bean是Showcases bean的精确副本。

这是我在输入不同密码并单击保存后在控制台中看到的内容:

[14/05/13 12:41:02:481 EST] 000000ee srt           W com.ibm.ws.webcontainer.srt.SRTServletResponse setIntHeader SRVE8094W: WARNING: Cannot set header. Response already committed.
[14/05/13 12:41:02:633 EST] 000000e8 srt           W com.ibm.ws.webcontainer.srt.SRTServletResponse setIntHeader SRVE8094W: WARNING: Cannot set header. Response already committed.
[14/05/13 12:41:09:371 EST] 000000e9 RenderRespons W   There are some unhandled FacesMessages, this means not every FacesMessage had a chance to be rendered.
These unhandled FacesMessages are: 
- Password 1 should match with Password 2.
[14/05/13 12:41:09:352 EST] 000000e9 SystemErr     R 10999369 [WebContainer : 1] INFO org.apache.bval.jsr303.ConfigurationImpl - ignoreXmlConfiguration == true

1 个答案:

答案 0 :(得分:1)

而不是更新matchGrid更新表单。 使用update = @ form