Prepared By: Rajat Gupta
Prepared By: Rajat Gupta
1. Restore view
2. Apply request values; process events
3. Process validations; process events
4. Update model values; process events
5. Invoke application; process events
6. Render response
This phase of the lifecycle presents three view instances: new view,
initial view, and postback, with each one being handled differently.
New view : JSF builds the view of the Faces page and wires the event
handlers and validators to the components. The view is saved in a
FacesContext object.
Initial view : (The first time a page is loaded), JSF creates an empty view.
The empty view will be populated as the user causes events to occur.
From an initial view, JSF advances directly to the render response phase.
Postback : (the user returns to a page she has previously accessed) the
view corresponding to the page already exists, so it needs only to be
restored. In this case, JSF uses the existing view's state information to
reconstruct its state. The next phase after a postback is apply request
values.
The purpose of the apply request values phase is for each
component to retrieve its current state. The components
must first be retrieved or created from the FacesContext
object, followed by their values. Component values are
typically retrieved from the request parameters