Develop web applications with JavaServer Faces (1)

zhaozj2021-02-16  48

Develop web applications with JavaServer Faces

http://developer.java.sun.com/developer/technicalarticles/gui/javaserverfaces/

By Qusay H. Mahmoudmay 2003

When you develop user interfaces for server-side, you can have a lot of choices, using JSP and Servlet Java developers generally use HTML user interface components to build user interfaces. This is mainly because HTML user interface components are the minimum subset of all web browsers. Of course, such a web application lacks expressive user interfaces compared to traditional independent fat clients, so there is less functionality and availability is not so good. Although Applet can be used to design a user interface, the developer of the web page may not be proficient in the Java program design.

Also, if you participate in a large Web system development, you may encounter some technical problems, such as how to implement a query component or a component such as a database application such as a table browsing component, and so on. Develop these custom components require specialized technology, and take some time to compile and test new libraries. In an ideal case, developers can use that have been pre-compiled and tested, while having high configurable components to integrate into their own development environment.

JavaServer Faces is a server-side technology that develops a web application that enriches features user interface. With its help, you can solve technical problems like creation customized user interface components. This is because JavaServer Faces technology is a user interface framework for developing a web application running on the server, which can provide the user interface to the client. That's right, the code of the user interface is running on the server, but it can respond to the various events generated by the client.

In fact, there have been many technologies that can develop expressive user interfaces, such as flash, swinglets, and jade. However, these solutions are proprietary, and development tools are generally always limited to a provider. The most important thing in JavaServer Faces is that it is a standard, which means that developers will not be locked to a separate developer. Developed this specification consisting of representatives of the main tool providers of Java Development Communities, which developers will not lack the tools that can be selected, and they can use the latest version of the tools currently used. However, although each developer cooperates with each other in developing norms, their specific implementation is competing. This allows developers to benefit, they can use the various features of tool providers, or select a variety of custom components.

JavaServer Faces Technology Based on the model view controller (MVC) to separate the application logic and expressions, if you understand the MVC mode, you can really understand JavaServer Faces technology.

This article is a quick entry tutorial. Through this article, you can start using JavaServer Faces to develop your own app. At the same time, this article also provides some other content:

Introduction to JavaServer Faces Technology

Benefits using JavaServer Faces

Describe the inner structure of JavaServer Faces

Describe the composition of JavaServer Faces technology

Give you the most intuitive feelings through an example of using JavaServer Faces.

Provide a routine, you can modify your own development

However, this article does not include how to develop content for customization.

JavaServer Faces Overview

JavaServer Faces is a technique advocated by Sun (other relevant can refer to JSR 127), and its main purpose is to provide a standard framework for the user interface for developing web applications. As mentioned earlier, JavaServer Faces allows you to develop a web application running on the Java server, which provides the client interface. This technology uses servlet as a controller, providing a functional component model that implements event processing and model performance. This provides a WEB application lifecycle management. JavaServer Faces has two main components:

Java APIs are used to provide UI components, status management, event processing, and check the functionality of user input data. These APIs also support international and easy to use. The JSP custom tag library used to express the JavaServer Faces user interface in a JSP page. Page developers can develop a colorful webpage through this tag library.

The following figure gives the relationship between the client, server side, and JavaServer Faces.

Figure 1: UI runs on the server

Here, this JSP page is not a hard-coded tag language, but is developed by using the JavaServer Faces custom tag library (Tag Library). The application's UI is used to manage the component objects included in the JSP page.

Many people can enjoy the benefits of this technology:

Web developers using tag language (such as HTML) can develop a colorful JavaServer Faces user interface using the JSP tag library.

Application developers can focus on developing model objects and event processing.

Components Developers can develop new custom components based on the components of JavaServer Faces.

Tool providers can integrate the JavaServer Faces technology to the new version of the development tool to simplify the development of web-based multi-layer applications.

This technology also opens the market for web user interface components. Developers and tool providers can build a user interface using JavaServer Faces custom components like wood.

One advantage of JavaServer Faces is to use models, views, and controller architecture (MVC) to clearly separate application logic and performance. You may feel that this may affect those who use existing web frameworks such as Struts. However, please note that JavaServer Faces and Struts are not competitive, in fact they can work well. However, JavaServer Faces is indeed more advantages over Struts. For example, in Struts, there is only one way to represent an element, but JavaServer Faces provides a variety of ways to represent an element. Choosing the appropriate manifestation design is the performance of the requirements is a web designer, and the application developers don't need to know which mechanism to use to represent the components. (About how to integrate JavaServer Faces and Struts, please refer to Integration of JavaServer Faces and Struts in fact, readers may have noticed that Sun's Craig McClanahan is the authors of Struts, but he is also the head of JavaServer Faces specification. character.

Please refer to: http://www.9cbs.net/develop/read_article.asp?id=18707 Develop web applications with JavaServer Faces (2)

Http://www.9cbs.net/develop/read_article.asp?id=18709 Develop web applications with JavaServer Faces (3)

Http://www.9cbs.net/develop/read_article.asp?id=18710 Develop web applications with JavaServer Faces (4) http://www.9cbs.net/develop/read_article.asp?id=18712 with JavaServer Faces Development web application (5)

转载请注明原文地址:https://www.9cbs.com/read-26945.html

New Post(0)