Parse Google Web Toolkit to develop Ajax (1)

Source: Internet
Author: User

GWT is a framework recently launched by Google to develop Ajax applications. It enables programmers to develop client and server code simultaneously in Java.

The GWT compiler converts the Java code used for developing the client into Javascript and Html, and the programmer does not need to care about this conversion process. In this way, programmers can develop their own Ajax applications in their favorite Java IDE.

GWT features

1. Dynamic and reusable UI Components

The component library provided by GWT enables users to easily develop beautiful UIS. Each component corresponds to a class of GWT. In the second part of this article, we will introduce in detail how GWT supports the UI.

2. Simple RPC call

With GWT, you can easily implement communication between the client and the server, especially making asynchronous communication quite simple. The later part of this article will introduce in detail the RPC call using GWT.

3. More convenient debugging

Because HTML section is not generated during the development phase, the code developed by the user is actually run on the JVM, so that the user can debug the program using the traditional Java code debugging method, this speeds up debugging and reduces the time required for software development.

4. browser compatibility

In most cases, programs developed with GWT support IE, Firefox, Mozilla, Safari, and Opera. users do not have to worry about browser compatibility during development. The compatibility of browsers is another tricky problem for programmers who use Javascript For Ajax application development.

5. scalability

If you think the APIS provided by GWT cannot meet your needs, you can use JSNI to directly embed Javascript statements into Java code.

Use GWT for UI development

In this section, we will discuss the support of GWT for UI development. GWT contains most of the components required for Web development, such as buttons and Text boxes. Figure 1 shows some UI components supported by GWT. From the image display effect, GWT can be used to make a very beautiful UI.

Figure 1: Some UI components supported by GWT

It is worth mentioning that each UI component must be placed in a control called Panel. The Panel has different styles, which also determines the UI style. Figure 2 shows some panels supported by GWT.

Figure 2: Some panels supported by GWT

After reading these components, we will use an experiment to describe how to add the UI components to the page. The final result of this experiment is a logon window.


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.