Primefaces密码匹配未处理的消息
我正在尝试让Primefaces 3.5密码匹配正常工作,但我一直收到一个错误,上面写着“有一些未处理的FacesMessages”,并且没有按预期显示正确的消息 我创建了一个非常简单的页面,并从Showcase中复制粘贴了代码,试图消除所有其他可能的原因,但问题仍然存在。这是一个非常简单的页面:Primefaces密码匹配未处理的消息,primefaces,passwords,match,Primefaces,Passwords,Match,我正在尝试让Primefaces 3.5密码匹配正常工作,但我一直收到一个错误,上面写着“有一些未处理的FacesMessages”,并且没有按预期显示正确的消息 我创建了一个非常简单的页面,并从Showcase中复制粘贴了代码,试图消除所有其他可能的原因,但问题仍然存在。这是一个非常简单的页面: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/
<!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>
更新表单而不是更新匹配网格。
使用update=@form而不是更新匹配网格更新表单。
使用update=@form您是对的,Sagar,并且您在Showcase代码中发现了一个错误。很明显,现在您已经指出:p:messages标记在panelGrid之外,这就是为什么更新panelGrid不会影响p:messages。对于比使用update=@form更有针对性的方法,我们可以像这样指定p:messages标记的id:update=“messages”。感谢您的帮助。您说得对,Sagar,您在Showcase代码中发现了一个错误。很明显,现在您已经指出:p:messages标记在panelGrid之外,这就是为什么更新panelGrid不会影响p:messages。对于比使用update=@form更有针对性的方法,我们可以像这样指定p:messages标记的id:update=“messages”。谢谢你的帮助。
[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