I am using Hibernate Validator with JSF, Richfaces. I have a text area wherein I input comma separated list of email domains.I have a hibernate ConstraintValidator which dutifully returns false if any of the email domains is not correct. In code elsewhere this constraint violation is captured & and an fatal error message is added to the FacesContext. But the error message is not displayed where I have the tag. Rather I get this in my console:
org.apache.myfaces.lifecycle.RenderResponseExecutor execute
WARNING: There are some unhandled FacesMessages, this means not every FacesMessage had a chance to be rendered.
These unhandled FacesMessages are:
- Invalid Domain Name.
Versions: hibernate-validator-4.3.0.Final, myfaces-impl-2.2.12, richfaces-components-api-4.3.5.Final. In my project almost same code has been used in some other page, only the backing bean is different & there it displays FacesMessage in my facelet without problem. I have gone through the source code of org.apache.myfaces.lifecycle.RenderResponseExecutor:
List<FacesMessage> messageList = facesContext.getMessageList();
if (!messageList.isEmpty())
{
StringBuilder builder = new StringBuilder();
boolean shouldLog = false;
for (int i = 0, size = messageList.size(); i < size; i++)
{
FacesMessage message = messageList.get(i);
if (!message.isRendered())
{
builder.append("\n- ");
builder.append(message.getDetail());
shouldLog = true;
}
}
if (shouldLog)
{
log.log(Level.WARNING, "There are some unhandled FacesMessages, " +
"this means not every FacesMessage had a chance to be rendered.\n" +
"These unhandled FacesMessages are: " + builder.toString());
}
}
If I view page source, I can see it is there:
<div class="error_block">
<span>Error </span> <br />
<table id="errorMessages"><tr><td class="displayErrorMessage">Invalid Domain Name.</td></tr></table>
</div></span>
But if I do F12 it is not there. So somehow the is not being part of DOM.