Java Reference
In-Depth Information
conversions, and events associated with these components will be processed during this
phase. If any conversion fails, an error message associated with the component is gener-
ated and queued on
FacesContext
. This message will be displayed during the Render
Response phase, along with any validation errors resulting from the Process Validations
phase.
At this point, if the application needs to redirect to a different web application resource or
generate a response that does not contain any JavaServer Faces components, it can call the
FacesContext.responseComplete
method.
At the end of this phase, the components are set to their new values, and messages and
events have been queued.
If the current request is identified as a partial request, the partial context is retrieved from
the
FacesContext
, and the partial processing method is applied.
Process Validations Phase
During this phase, the JavaServer Faces implementation processes all validators registered
on the components in the tree, by using its
validate
(
processValidators
) meth-
od. It examines the component attributes that specify the rules for the validation and com-
pares these rules to the local value stored for the component. The JavaServer Faces imple-
mentation also completes conversions for input components that do not have the
imme-
diate
attribute set to true.
If the local value is invalid, or if any conversion fails, the JavaServer Faces implementa-
tion adds an error message to the
FacesContext
instance, and the lifecycle advances
directly to the Render Response phase so that the page is rendered again with the error
messages displayed. If there were conversion errors from the Apply Request Values phase,
the messages for these errors are also displayed.
If any
validate
methods or event listeners have called the
renderResponse
method
on the current
FacesContext
, the JavaServer Faces implementation skips to the
Render Response phase.
At this point, if the application needs to redirect to a different web application resource or
generate a response that does not contain any JavaServer Faces components, it can call the
FacesContext.responseComplete
method.
If events have been queued during this phase, the JavaServer Faces implementation broad-
casts them to interested listeners.