background image

Render Response Phase

<< Update Model Values Phase | Using JavaServer Faces Technology >>
<< Update Model Values Phase | Using JavaServer Faces Technology >>

Render Response Phase

Render Response Phase
During this phase, the JavaServer Faces implementation delegates authority for rendering the
page to the JSP container if the application is using JSP pages. If this is an initial request, the
components represented on the page will be added to the component tree as the JSP container
executes the page. If this is not an initial request, the components are already added to the tree
so they needn't be added again. In either case, the components will render themselves as the JSP
container traverses the tags in the page.
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 during
this phase. If the pages contain message or 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 subsequent
requests can access it and it is available to the restore view phase.
In the case of the guessNumber example, if a request for the greeting.jsp page is an initial
request, an empty view representing this page is built and saved in FacesContext during the
restore view phase. During this phase, the empty view is populated with the components
referenced in the page and then rendered during this phase. If a request for the page is a
postback (such as when the user enters some invalid data and clicks Submit), the tree is rebuilt
during the restore view phase and continues through the request processing life cycle phases.
Further Information about JavaServer Faces Technology
For more information on JavaServer Faces technology, see:
The JavaServer Faces 1.2 TLD documentation:
http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/index.html
The JavaServer Faces 1.2 standard Render Kit documentation:
http://java.sun.com/
javaee/javaserverfaces/1.2/docs/renderkitdocs/index.html
The JavaServer Faces 1.1 API Specification:
http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html
The JavaServer Faces 1.1 Specification:
http://java.sun.com/javaee/javaserverfaces/download.html
The JavaServer Faces web site:
http://java.sun.com/javaee/javaserverfaces
Further Information about JavaServer Faces Technology
The Java EE 5 Tutorial · September 2007
318