| ||||||||||||||||||||||||||||||||
Restore view
RestoreView is the first phase in the JSF lifecycle. This phase is used for constructing view to display in the front end. Every view has it's own view id and it is stored in the FacesContext's session object. JSF View is collection of components associated with its current state. There is two types of state saving mechanism,- Server (default)
- Client
Apply Requests
After the component tree is restored, each component in the tree extracts its new value from the request parameters by using its decode method. The value is then stored locally on the component. If the conversion of the value fails, an error message associated with the component is generated 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.Process Validations
During this phase, the JavaServer Faces implementation processes all validators registered on the components in the tree. It examines the component attributes that specify the rules for the validation and compares these rules to the local value stored for the component.Update Model Values
After the JavaServer Faces implementation determines that the data is valid, it can walk the component tree and set the corresponding server-side object properties to the components' local values. The JavaServer Faces implementation will update only the bean properties pointed at by an input component's value attribute.If the local data cannot be converted to the types specified by the bean properties, the life cycle advances directly to the render response phase so that the page is rerendered with errors displayed. This is similar to what happens with validation errors.
Invoke Applications
During this phase, the JavaServer Faces implementation handles any application-level events, such as submitting a form or linking to another page.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 FacesContext.responseComplete.
If the view being processed was reconstructed from state information from a previous request and if a component has fired an event, these events are broadcast to interested listeners.
No comments:
Post a Comment