Java Server Faces Question:

Download Job Interview Questions and Answers PDF

What is JSF life cycle?

Java Server Faces Interview Question
Java Server Faces Interview Question

Answer:

i. Restore view phase:
This phase starts when a user requests a JSF page by clicking a link, button etc. In this phase view generation of the page, binding of components to its event handlers and validators are performed and view is saved in the FacesContext object.

ii. Apply request values phase:
The purpose of this phase is for each component to retrieve its current state.

iii. Process validations phase:
During this phase local values stored for the component in the tree are compared to the validation rules registered for the components.

iv. Update model values phase:
After confirming that data is valid in the previous phase local values of components can be set to corresponding server side object properties i.e. backing beans.

v. Invoke application phase:
Before this phase the component values have been converted, validated, and applied to the bean objects, so you can now use them to execute the application's business logic.

vi. Render response phase:
In this phase JSP container renders the page back to the user, if jsp is used by application i.e. view is displayed with all of its components in their current state

Download Java Server Faces Interview Questions And Answers PDF

Previous QuestionNext Question
What is JSF Taglibs?What is JavaServer Faces, JSF?