Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

isValidationFailed default value

What would the method facesContext.isValidationFailed() return after the Render Response Phase when the validation fails? It returns false for me in this case.

like image 408
Narayana Nagireddi Avatar asked Dec 11 '25 22:12

Narayana Nagireddi


1 Answers

It will only return true when FacesContext#validationFailed() has been called by the JSF validation internals or by your own code as follows:

FacesContext.getCurrentInstance().validationFailed();

As far JSF internal code is concerned, only UIInput#processValidators() and UIViewParameter#processValidators() will implicitly call this method whenever a ValidatorException has been caught.

If it returns false for you, then you're apparently doing validation in a non-standard way. For example inside the action method, while you should be using a real Validator for this.

like image 144
BalusC Avatar answered Dec 15 '25 22:12

BalusC