I have decided to dig completely into JSF 2.0 as my project demands deep knowledge of it. I am reading JSF Lifecyle Debug, a well written and awesome article on JSF Life cycle. While reading this article, I have following confusions.
If it's an initial request, in
Restore View Phase
an empty View is created and straightRender Response Phase
happens. There is no state to save at this point. What actually happens inrender response phase
then? I am confused a little while I am running the example.The article states that, retrieved input value is set in
inputComponent.setSubmittedValue()
inApply Request Values
phase. If validation and conversion passes, then the value gets set ininputComponent.setValue(value)
andinputComponent.setSubmittedValue(null)
runs. On same point article states that, now if in the next post back request, value is changed, it is compared with the submitted value which would always be null on every post back, value change listener
will be invoked. It means if, we don't change the value even, as submittedValue would be null, valueChangeListener will always be invoked? I am confused on this statement. Can someone elaborate on this?Article states the usage of
immediate
attribute. Ifimmediate
attribute is set on an input component, than ideallyProcess Validation Phase
is skipped, but all of the conversion and validation happens inApply Request Values
. My point is, still when the conversion and validation is happening, what's the advantage of skipping the third phase?What does the term retrieved value means?
I would like to know, if lets say there are five fields on the view. Does JSF makes a list of some collection of these values and
Apply Request Values
andProcess Validations
phase iterate over them one by one?At the last point of this article where it states, when to use
immediate
attribute. As per my understanding, if immediate attribute is set in both input component and command component, It will skip the phases from Apply Request Values to Invoke Application for any attribute not havingimmediate
. Then what does the last statement mean "Password forgotten" button in a login form with a required and immediate username field and a required but non-immediate password field.
I know these are very basic confusions but clarity on these topics will definitely help sharpen the JSF knowledge.