The Request Processing Lifecycle. Flows with dotted lines are
optional. JSF cycles through several phases as it processes each request.
After each phase, event listeners are called. Listeners can either continue
as normal, report errors and skip to the Render Response phase, or generate
the response themselves.
After most phases, JSF will broadcast events to any interested listeners (events
can be associated with a particular phase). Event listeners perform application
logic or manipulate components; they can also jump to the final phase, Render
Response. A listener can even skip the final phase and render a response itself. It
might do this if it were returning binary content, performing a redirect, or returning
other content that isn’t related to JSF, like XML documents or ordinary HTML.
Four of these phases can generate messages: Apply Request Values, Process Validations, Update Model Values, and Invoke Application. With or without messages,
it is the Render Response phase that sends output back to the user, unless
a listener, renderer, or component has sent the response itself.
Phase Description Events fired
Restore View Finds or creates a tree of components for the selected
view. Some components, like HtmlCommandButton, will
generate action events (or other types of events) in this
phase.
Phase events
Apply Request Values Updates the value of the components to equal ones sent
in the request, optionally using converters. Adds conversion
errors if there is an error. Also generates events from
request parameters.
Phase events, data
model events,
action events
Process Validations Asks each component to validate itself (which may
include using external validators). Validation error messages
may be reported.
Phase events, data
model events,
value-change
events
Update Model Values Updates all the values of backing beans or model objects
associated with components. Conversion error messages
may be reported.
Phase events, data
model events,
Invoke Application Calls any registered action listeners. The default action
listener will also execute action methods referenced by
command components (like HtmlCommandButton) and
choose the next view to be displayed.
Phase events,
action events
Render Response Displays the selected view using the current display technology
(like JSP).
Phase events