Validator/Messages

Why does this not print out the queued message

public void validatePassword(FacesContext context, UIComponent component, Object value) {

if (!passwordInput.getLocalValue().equals(value)) {

FacesMessage message = new FacesMessage();

message.setSeverity(FacesMessage.SEVERITY_ERROR);

message.setSummary("Password Mismatch");

message.setDetail("Your passwords do not match.");

throw new ValidatorException(message);

}

}

<tr>

<td>

Password:

</td>

<td>

<h:inputSecret id="password" value="#{NewUser.password}">

</h:inputSecret>

</td>

<td><h:message for="password"></h:message></td>

</tr>

<tr>

<td>

Re-enter Password:

</td>

<td>

<h:inputSecret id="verify" validator="#{NewUser.validatePassword}">

</h:inputSecret>

</td>

</tr>

[954 byte] By [amattasa] at [2007-11-27 11:07:28]
# 1

Because the h:message is attached to the 1st field and not to the 2nd field.

BalusCa at 2007-7-29 13:22:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

One other question I have is where it calls validatePassword I get a syntax error in Eclipse saying

MethodBinding attribute values must be EL expressions.CIWeb/WebRoot/adminnewuser.xhtmlline 5511848712913025123

amattasa at 2007-7-29 13:22:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...