Getting Started with Ajax:google WEB Toolkit for Java Developers

Source: Internet
Author: User

Introduction to Ajax

AJAX is the acronym for asynchronous JavaScript and XML (and DHTML, etc.), and is composed of XHTML, CSS, JavaScript, XMLHttpRequest, XML, etc. is a popular technology in the current Web application development field to create more dynamic and interactive Web applications that enhance the user's browsing experience.

The core of Ajax is the JavaScript object XMLHttpRequest. XMLHttpRequest is an object that handles all server communications and is a technology that supports asynchronous requests. In short, XMLHttpRequest allows you to use JavaScript to make requests to the server and process the response without blocking the user.

Ajax is not the focus of this article, so don't go into the details here, please visit the Reference Resource area links to learn more about AJAX technology and applications.

Why do you choose GWT?

As we all know, even for developers who are very familiar with Ajax technology, the development and debugging of AJAX applications is not an easy task, and more difficult, so far, there has been no suitable development tools to support the development and debugging of AJAX applications.

In contrast, the development and commissioning of the Java language-the mainstream language for enterprise application development-is much simpler because of the support of a wide variety of development tools, and we can get it for free, such as Eclipse, NetBeans.

If you can apply the Java language Development Ajax,ajax application development's biggest challenge-the lack of development tools-will be solved. In this case, we can take full advantage of the development advantages of the Java language to reduce the difficulty of AJAX application development, speed up the development of AJAX applications, create the potential for large-scale AJAX applications, and give full play to the advantages of AJAX technology to create more dynamic and interactive Web applications, Enhance the user's browsing experience.

The advent of Google Web Toolkit (GWT) provides us with this possibility. GWT is Google's AJAX application Development Kit, which enables developers to develop AJAX applications using the Java language. The GWT framework itself is open source, but the development tools in GWT provide only license for development purposes and are not allowed to be distributed.

GWT provides a set of Java-language-based development packages that are designed to refer to the Java AWT Package design, class naming rules, interface design, event monitoring, and so on, which are very similar to AWT. Developers familiar with Java AWT do not need much effort to quickly understand the GWT development toolkit and spend more time in the development of GWT applications.

The Java application developed will be compiled with the compiler tools provided by the GWT development package to generate a corresponding, AJAX-enabled Web application, and the interaction between the server and the Java application is replaced by an automatically generated asynchronous calling code.

GWT Features

GWT, in addition to supporting the application of Java language development applications to AJAX applications, while providing more advanced features, the following is a brief description of these features.

1. GWT Compiler

The GWT compiler is the core of GWT and is responsible for doing the work of translating Java code into AJAX content. The GWT compiler can translate most of the features of the Java language. This includes supporting basic types in the Java language, offending, and so on, supporting most of the classes and interfaces in Java.lang and java.util packages, and supporting regular expressions and serialization.

2. Cross-platform support

If you use the display components (such as button) and assembly components (such as Verticalpanel) provided in GWT, the AJAX applications generated by GWT compilation can support most browsers and operating systems, such as Internet Explorer, Firefox, etc. can also support different operating systems such as Linux, Windows, and so on. This is because GWT maximizes the translation of these controls into a browser-built type. For example, the button class is compiled to produce the standard html:<input type= "button" >.

GWT recommends using CSS to decorate the display of page elements. GWT's classes rarely provide a way to access page element style properties, and we can set the default display of page elements directly in the CSS file by corresponding style names. For example, use the. Gwt-button {font-size:150%} to use the default display effect of the Button element.

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.