I had a doubt regarding Messages being set in the custom validator in JSF 2.0. here is the code
public void validate(FacesContext context, UIComponent component,
Object value) throws ValidatorException {
matcher = pattern.matcher(value.toString());
if(!matcher.matches()){
FacesMessage msg =
new FacesMessage("E-mail validation failed.",
"Invalid E-mail format.");
msg.setSeverity(FacesMessage.SEVERITY_ERROR);
throw new ValidatorException(msg);
}
}
Now here I am curious about how is it actually working, since we haven t written the part of the code context.add(msg)
SO没有在面目中添加这些讯息,它如何设法在国库上检索?