JSF and Facelets of Java EE

Source: Internet
Author: User

JSF: A standard framework for building Java Web

The JSF lifecycle is divided into two main phases of the run and render phases

Run Phase :

When you first request, build or restore the application view. For other subsequent requests, to perform other operations, the execution phase is divided into the following sub-stages:

1. Restore the View stage

2. Application Request Value Phase

3. Process Validation Phase

4. Update Model Value phase

5. Call the application phase

6. Rendering Response Phase

Detailed descriptions of the stages are as follows:

Render Phase :

At this stage, the requested view responds as a client-side browser. View rendering is the process of generating output in HTML or XHTML.

Take the following steps during the rendering process:

1, when the customer service side of the Index.xhtml Web page to make the initial request, compile the application.

2. After the application is compiled, a component tree is built for the application and placed in the Facescontex.

3. Populate the component tree with the components represented by the El expression and their associated managed bean properties.

4. Build a new view based on the component tree.

5. The view is presented as a response to the request client.

6, the component tree is automatically destroyed.

7. In the subsequent request, rebuild the component tree and apply the saved state.

Examples of event processing in the JSF lifecycle:

In a JSF application, the JSF implementation uses a controller servlet to process the request and then executes the JSF lifecycle. JSF is event-driven, starting with the application request value phase, which creates events and adds them to the event queue during each life cycle phase.

For detailed stages, see: https://www.yiibai.com/jsf/jsf-life-cycle.html

Facelets;

Defined:

A lightweight page-declaration language. Used to build JSF views using HTML styles. is an alternative presentation technology for building JSF applications that provides a powerful templating system to choose from, using HTML-style templates to define the JSF presentation layer, reducing redundant code when components are integrated into the presentation layer.

Function:

One: Creating a Web page with XHTML

II: In addition to supporting JSF and jslt tag libraries, the Facelets tag library is also available

Three: Support Expression language

Four: Working with components and page templates

For details, see: http://www.yiibai.com/jsf/facelets.html

JSF and Facelets of Java EE

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.