0% found this document useful (0 votes)
54 views11 pages

Java Server Faces

The document discusses the life cycle of Java Server Faces (JSF), which dictates how requests are handled and responses generated. The life cycle has two main methods - execute which handles postback processing, and render which renders the view. Each method uses phases to accomplish its task, with the execute phases validating submitted values and updating models, and the render phase constructing the component page and rendering it into markup.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views11 pages

Java Server Faces

The document discusses the life cycle of Java Server Faces (JSF), which dictates how requests are handled and responses generated. The life cycle has two main methods - execute which handles postback processing, and render which renders the view. Each method uses phases to accomplish its task, with the execute phases validating submitted values and updating models, and the render phase constructing the component page and rendering it into markup.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Java Server Faces

(JSF)
The Four Pillar of JSF
Life Cycle of JSF

“execute”
portion of Lifecycle

“render”
portion of Lifecycle

3
Life Cycle of JSF

• The Lifecycle dictates how an incoming request is


handled and how a response is generated.
• Primarily concerned with
– Finding the View on which to operate
– Allowing components to get their values
– Ensuring the values are converted and validated
– Ensuring any event listeners are called
– Updating the model
– Selecting and rendering the new view
Life Cycle of JSF

• You don't need to invoke the Lifecycle yourself


• Two methods
– execute
Handles the postback processing for the request
– render

Renders the view


• Each method uses a number of “phases” to
accomplish its task.
Life Cycle of JSF
Restore an old or construct a new component page (or view)
Life Cycle of JSF
An old view (component tree) has been retrieved so allow each component in
the view to inspect data values. These values will be redisplayed if validation
or conversion errors are found.
Life Cycle of JSF
The submitted values are stored as “local values”. If the data is invalid or
conversions are not possible then Render Response is called directly and the
user sees the bad data.
Life Cycle of JSF
Local values are OK and are used to update the beans.
Life Cycle of JSF
The action method associated with the button or link that caused the form to
be submitted is executed. The method returns a string for the navigation
handler. The navigation handler uses the string to determine the next page.
Life Cycle of JSF
The selected page is rendered into a markup language.

You might also like