10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Further Information about <strong>Java</strong>Server FacesTechnology<br />

Render Response Phase<br />

During this phase, the <strong>Java</strong>Server Faces implementation delegates authority for rendering the<br />

page to the JSP container if the application is using JSP pages. If this is an initial request, the<br />

components represented on the page will be added to the component tree as the JSP container<br />

executes the page. If this is not an initial request, the components are already added to the tree<br />

so they needn’t be added again. In either case, the components will render themselves as the JSP<br />

container traverses the tags in the page.<br />

If the request is a postback and errors were encountered during the apply request values phase,<br />

process validations phase, or update model values phase, the original page is rendered during<br />

this phase. If the pages contain message or messages tags, any queued error messages are<br />

displayed on the page.<br />

After the content of the view is rendered, the state of the response is saved so that subsequent<br />

requests can access it and it is available to the restore view phase.<br />

In the case of the guessNumber example, if a request for the greeting.jsp page is an initial<br />

request, an empty view representing this page is built and saved in FacesContext during the<br />

restore view phase. During this phase, the empty view is populated with the components<br />

referenced in the page and then rendered during this phase. If a request for the page is a<br />

postback (such as when the user enters some invalid data and clicks Submit), the tree is rebuilt<br />

during the restore view phase and continues through the request processing life cycle phases.<br />

Further Information about <strong>Java</strong>Server FacesTechnology<br />

316<br />

For more information on <strong>Java</strong>Server Faces technology, see:<br />

■ <strong>The</strong> <strong>Java</strong>Server Faces 1.2 TLD documentation:<br />

http://download.oracle.com/<br />

docs/cd/E17477_01/javaee/5/javaserverfaces/1.2/docs/tlddocs/<br />

■ <strong>The</strong> <strong>Java</strong>Server Faces 1.2 standard Render Kit documentation:<br />

http://download.oracle.com/<br />

docs/cd/E17477_01/javaee/5/javaserverfaces/1.2/docs/renderkitdocs/<br />

■ <strong>The</strong> <strong>Java</strong>Server Faces 1.2 Specification:<br />

http://jcp.org/en/jsr/detail?id=252<br />

■ <strong>The</strong> <strong>Java</strong>Server Faces web site:<br />

http://java.sun.com/javaee/javaserverfaces<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!