Java Reference
In-Depth Information
Render Response Phase
During this phase, JavaServer Faces builds the view and delegates authority to the appro-
priate resource for rendering the pages.
If this is an initial request, the components that are represented on the page will be added
to the component tree. If this is not an initial request, the components are already added to
the tree, so they need not be added again.
If the request is a postback and errors were encountered during the Apply Request Values
phase, Process Validations phase, or Update Model Values phase, the original page is
rendered again during this phase. If the pages contain h:message or h:messages
tags, any queued error messages are displayed on the page.
After the content of the view is rendered, the state of the response is saved so that subse-
quent requests can access it. The saved state is available to the Restore View phase.
Partial Processing and Partial Rendering
The JavaServer Faces lifecycle spans all of the execute and render processes of an applic-
ation. It is also possible to process and render only parts of an application, such as a single
component. For example, the JavaServer Faces Ajax framework can generate requests
containing information on which particular component may be processed and which par-
ticular component may be rendered back to the client.
Once such a partial request enters the JavaServer Faces lifecycle, the information is iden-
tified and processed by a javax.faces.context.PartialViewContext object.
The JavaServer Faces lifecycle is still aware of such Ajax requests and modifies the com-
ponent tree accordingly.
The execute and render attributes of the f:ajax tag are used to identify which compon-
ents may be executed and rendered. For more information on these attributes, see Chapter
4 , Using Ajax with JavaServer Faces Technology .
The Lifecycle of a Facelets Application
The JavaServer Faces specification defines the lifecycle of a JavaServer Faces application.
For more information on this lifecycle, see “ The Lifecycle of a JavaServer Faces Applica-
tion on page 50 . The following steps describe that process as applied to a Facelets-based
application.
1. When a client, such as a browser, makes a new request to a page that is created
using
Facelets,
a
new
component
tree
or
Search WWH ::




Custom Search