Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Ajax and JSF use Rational Application Developer V7 to implement Web applications

2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces Ajax and JSF how to use Rational Application Developer V7 to achieve Web applications, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

Advantages and disadvantages of Ajax

Although not a revolutionary innovation, Ajax technology has become very popular in the past two years. A large number of major Web sites (such as Google, Yahoo!, Amazon, and Netflix) use this technology to improve the access experience of users of their sites. In fact, improving the user experience is exactly what Ajax does.

In the development of Web applications over the past decade, the interaction between users and browsers and between browsers and servers is clearly defined and obvious: users browse the web within the browser, perform actions (select content from the context menu, or select some check boxes), and then instruct the browser to communicate with the server by clicking the link or submit button. The browser sends a request to the server and passes the user input. The server processes the request and returns a response, which may be an updated page or the same page, which has been updated.

Such Web applications are now called Web 1.0. From a user experience point of view, they have two drawbacks:

The interaction between the ◆ browser and the server can only be initiated by a limited number of controls on the page-- often links and buttons. This makes it impossible to notify the server quickly after the user selects the check box (check box) or after the combo box (combo box).

The consequence of this interaction between the ◆ browser and the server is that the entire browser window needs to be updated. This situation is usually slow, and page updates often require users to wait a long time. To make matters worse, it often flashes in the browser window when the same page is reloaded or refreshed.

The new generation of Web applications called Web 2.0 makes up for these shortcomings by making use of Ajax technology (also known as AJAX, or Asynchronous JavaScript and XML, asynchronous JavaScript and XML). In Ajax, the interaction between the browser and the server takes place in the background and will not be noticed by the user. And it is more targeted than a normal "browser-server" interaction, which only needs to send a subset of the pages to the server, and the server only returns the subset of pages that need to be updated. The result of this approach is that communication between the browser and the server can be initialized by any event, such as selecting in a combo box or check box, or a mouse pointer pause event. This has brought great benefits:

◆ communicates faster because it transmits less data.

◆ users stay on the same page because there is no need for too much navigation between pages.

Pages reloaded by ◆ do not flash because only a small portion of the page is updated according to the Ajax request.

The idea behind Ajax is simple: listen for events in the browser, send background requests to the server, and update parts of the page when the server responds. But the implementation process is very complex. It requires in-depth knowledge of JavaScript ™, client-server communication protocols, and server code. The differences between different browser versions make development and debugging more difficult. However, IBM ®Rational ®Application Developer Version 7 provides all the tools you need to develop Ajax Web applications without having to implement all the underlying details.

Rational Application Developer V7 provides:

JSF extended by ◆ allows processing of Ajax requests in JavaServer ™Framework (JSF)

◆ A JavaScript ™library that initializes Ajax requests in all major browsers and responds on the server side to update only part of the page

The technical details of the Ajax and JSF implementations in Rational Application Developer V7 are beyond the scope of this article, but let's take a look at how you use these technologies.

How to apply Ajax with JSF components

Adding Ajax to a JSF page requires four steps:

1. Identify the area of the page that is updated by the Ajax request. In Rational Application Developer V7, you can use Ajax in the content of almost any panel component. Panels range from simple containers, such as and, to feature-rich panels, such as menus () and dialog boxes ().

two。 Select the type of Ajax request to use. The Rational Application Developer V7 JSF library supports three Ajax requests:

◆ 's GET request for the same page ()

◆ 's POST request for the same page ()

◆ 's GET requests to other pages ()

3. Apply the Ajax request to configure the parameters passed to the server.

◆ for GET requests, you can pass values from different input fields in the page.

◆ submits all forms for POST requests.

4. Identify the event that initiates the Ajax request. It can be any client-side JavaScript event, such as the onclick of the button, the onblur of the input field, or the onchange of the check box.

Thank you for reading this article carefully. I hope the article "how Ajax and JSF use Rational Application Developer V7 to implement Web applications" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report