I was wondering what is the correct way of implementing the custom Validator in JSF 1.2. In my Validator class'
public void validate(FacesContext context, UIComponent component,Object value) throws ValidatorException {}
method, I am doing the validation check and just adding the FacesMessage
instance to the context by context.addMessage(new FacesMessage(xxx...);
in case of invalid condition. This seems to be working fine in my application. However, I am not sure if I also need to explicitely throw new ValidatorException()
for JSF to handle the lifecycle correctly? Or would JSF be smart enough to look at the error messages in context to manage the lifecycle?