Insight into JSF Technology

Source: Internet
Author: User
This article describes how JSF components simplify JSF web development and describes the advantages of this technology. The User Interface Component Model is the first web framework technology developed by JSF. It is an important feature that distinguishes JSF from other Web frameworks. At the same time, these technologies are the only guarantee for JSF to carry the future.

Assumerver faces is a Web user interface framework launched by Sun. It is released along with Java ee 5, a new version of J2EE. The goal of JSF is to simplify web development. For this reason, Sun has put forward many technical measures in JSF, including UI components, event-driven and managed bean. This topic will introduce several representative technologies in JSF's simplified web development technology in series, in an attempt to give readers a general understanding of JSF technology, to understand how JSF simplifies web development. This is the first article in the series. It introduces the technical features of JSF in general.

1. Introduction to JavaServer faces
Assumerver faces is a technology developed by Sun, or JSF for short. According to Sun's definition, JSF is a Java Web Application User interface framework designed to simplify web application development and maintenance. JSF simplifies web application development in four aspects: First, JSF provides a set of user interface components that can be reused, programmers can use these components to easily construct the web application user interface. Second, using JSF, it is very easy to transmit data between the user interface component and the business logic. Third, JSF can maintain the state of user components and pass the State from one request to another. Fourth, JSF allows programmers to easily develop Custom User interface components, these Custom User interface components can also be reused.

Another important feature of JSF technology is that JSF is tool-oriented. JSF has established an open standard based on which tool vendors can provide powerful tool support for various roles in Web application development. For example, a visual page editor can provide page designers with the "what you see is what you get" function. To build a webpage, simply drag and drop user interface components from the panel to the webpage; for example, JSF's page navigation can also be operated using tools to draw a line between page A and page B and specify a logical exit, defines a conditional transition from page a to page B.

If you do not want to use tools, or some tools are not yet available, you can also use JSF to easily build Web applications. JSF opens APIs for frameworks and programming models to programmers. Some advanced users, such as core programmers, can use these APIs to write code to meet certain special requirements of applications. For example, in JSF, the user interface component communicates with the backend bean through the expression language. JSF defines the standard syntax of the expression language. If these syntaxes cannot meet the application requirements, programmers can write their own expression language interpreters, and then use the API to replace the default interpreter with a custom interpreter.

When developing JSF specifications, the JSF Expert Group made a high degree of abstraction and induction on Web applications, which made JSF technology much higher than other popular web frameworks. At the standard level, the core architecture of JSF is independent of the specific transmission protocol and the specific identification language. The Protocol is independent from the language and lays a solid foundation for the application of JSF technology in other fields.

Of course, the most direct service object of JSF is a Java Web Application Based on HTTP protocol and HTML client. Java Web applications run on Java application servers that support servlet or JSP technology. These applications are usually form-based and consist of several pages, users can access the functions provided by Web applications through pages and forms. Writing such an application using the existing Java Web technology is not an easy task. Programmers are faced with many difficulties, such as how to manage the status of user components across requests, how to encapsulate the differences between different browsers, how to process forms, How to Write server-side processing routines for client events, how to verify the validity of request data, and how to convert data types between request strings and background objects, how to handle exceptions and give appropriate prompts and how to navigate between pages. The goal of JSF is to solve these problems.
 
2. Representative JSF simplified Web Development Technology
From a technical point of view, JSF is a very complex framework. Therefore, the complete introduction of JSF technology is a "big project ", the content includes the request processing lifecycle, user interface component model, standard user interface components, Unified Expression Language, managed bean mechanism, request context status information, page navigation method, and presentation mode. integration with JSP and lifecycle management. Due to the limited length and time, this article only lists the key points and does not cover all the details of JSF. However, even so, it is enough to show the adequacy of JSF technology in some aspects.

The best way to describe the adequacy of a technology is to compare it with its competitors. In Java Web programming, the biggest competitor of JSF is undoubtedly JSP and struts. The former is the best choice for junior programmers, while the latter is the de facto framework standard of Java Web. It is undeniable that JSP and struts are both excellent technologies. However, from the perspective of abstract thinking, we will find that the abstract layers of JSP and struts are lower than that of JSF.

In the web application architecture, it is clear that the Web server is at the bottom of the Abstraction Level and directly processes HTTP requests and responses. The servlet is on top of the web server, it has functions such as session management, lifecycle management, and basic error handling. jsp is on top of servlet, thanks to its scalable template mechanism, JSP has a higher abstraction level than servlet. Then, we come to sturts. As a framework standard, Struts provides a wealth of services, for example, type conversion, navigation, form processing, and layout management. Struts is of model 2, but it also carries some features of model 1, while JSF with a higher abstraction level, it is totally Model 2. Compared with Struts, JSF contains all the Model 2 features of struts, it also introduces the user interface components and event modes that struts does not possess, as well as the integration of the front-end interface and background business logic. Therefore, JSF is a technology that is more abstract than struts.

The above section only compares JSF, JSP, and Struts technologies in general. In order to make the comparison more specific and give readers a general understanding of JSF technology, in subsequent articles in this series, we will select some representative JSF technical points for discussion, including:
JSF User Interface Component Model
Managed bean mechanism of JSF
Event-driven mode of JSF
JSF Navigation Method
Unified Expression Language of JSF
JSF type converter
JSF data verification
JSF data table component
JSF Selection Component
JSF internationalization features
It should be noted that these are not all the technical points of JSF. The reason for choosing these technical points is that these technologies have the most direct connection with JSF's goal of "Simplifying web development. With the support of tools, it is easy for programmers to write Web applications based on JSF.

Source: http://tech.it168.com/j/n/2007-03-22/200703220944818.shtml

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.