Java Reference
In-Depth Information
The JavaServer Faces application lifecycle execute phase contains the following sub-
phases:
• “ Restore View Phase on page 53
• “ Apply Request Values Phase on page 53
• “ Process Validations Phase on page 54
• “ Update Model Values Phase on page 55
• “ Invoke Application Phase on page 55
• “ Render Response Phase on page 55
Restore View Phase
When a request for a JavaServer Faces page is made, usually by an action such as when
a link or a button component is clicked, the JavaServer Faces implementation begins the
Restore View phase.
During this phase, the JavaServer Faces implementation builds the view of the page,
wires event handlers and validators to components in the view, and saves the view in the
FacesContext instance, which contains all the information needed to process a single
request. All the application's components, event handlers, converters, and validators have
access to the FacesContext instance.
If the request for the page is an initial request, the JavaServer Faces implementation cre-
ates an empty view during this phase and the lifecycle advances to the Render Response
phase, during which the empty view is populated with the components referenced by the
tags in the page.
If the request for the page is a postback, a view corresponding to this page already exists
in the FacesContext instance. During this phase, the JavaServer Faces implementa-
tion restores the view by using the state information saved on the client or the server.
Apply Request Values Phase
After the component tree is restored during a postback request, each component in the tree
extracts its new value from the request parameters by using its decode ( processDe-
codes() ) method. The value is then stored locally on each component.
If any decode methods or event listeners have called the renderResponse method
on the current FacesContext instance, the JavaServer Faces implementation skips to
the Render Response phase.
If any events have been queued during this phase, the JavaServer Faces implementation
broadcasts the events to interested listeners.
Search WWH ::




Custom Search