better understanding of JSF Life cycle
Posted
by gurupriyan.e
on Stack Overflow
See other posts from Stack Overflow
or by gurupriyan.e
Published on 2010-06-01T10:56:59Z
Indexed on
2010/06/01
11:23 UTC
Read the original article
Hit count: 224
jsf
I need your help to understand this better. This is my case. I have a custom validator for each of my input controls in the form. So when there is any validation error,I add a corresponding FacesMessage in the validate method. My understanding was that when there is any validation error - or when there are any FacesMessages added in the validate method of the Custom Validator, it would skip the INVOKE APPLICATION phase and would directly call the RENDER RESPONSE PHASE - showing the FacesMessage that was added in the PROCESS VALIDATION Phase - Is this correct?
The problem I'm facing is - I add a FacesMessage in the PROCESS VALIDATION Phase - because of a validation error - and I add a confirmation message for the action that was taken by the user in the INVOKE APPLICATION PHASE - Now both are shown in the page in the RENDER RESPONSE Phase ? - If my understanding is correct in the above question - is it the best practice to conditionally add a confirmation FacesMessage after confirming that there are no FacesMessages in the currect FacesContext ?
Appreciate your help.
© Stack Overflow or respective owner