Ajax technology is currently a very popular technology to develop Web applications, but also an important part of Web 2.0. However, if Ajax is developed in a traditional manner, it makes it very difficult for the application to debug and thus reduces productivity. Google's latest GWT is expected to solve the problem for us, and GWT is a framework for developing AJAX applications that allows programmers to develop both client and server-side code in Java. The GWT compiler translates Java code for development clients into JavaScript and HTML, and programmers don't care about the conversion process. This allows programmers to develop their own AJAX applications within their favorite Java IDE.
This article mainly from the following aspects of the introduction:
1, GWT features Introduction
2. Using GWT for UI development
3, with JavaScript development AJAX application Introduction
4. Using GWT for AJAX development
Introduction to GWT Features
1. Dynamic, reusable UI components
The component library provided by GWT makes it easy for users to develop beautiful UIs, each of which corresponds to one of GWT's classes. The second section of this article provides a more detailed overview of GWT's support for the UI.
2. A simple RPC call
With GWT, you can easily implement client and server-side communication, especially making asynchronous communication very simple. The RPC calls made using GWT are described in detail later in this article.
3. More Convenient debugging
Since there is no need to generate HTML sections during the development phase, the user-developed code is actually running on the JVM, so that users can debug the program with the traditional method of debugging Java code, thus speeding up the speed of debugging and reducing the time of software development.
4. Browser compatibility
In most cases, programs developed with GWT support IE, Firefox, Mozilla, Safari, and opera, and users don't have to worry about browser compatibility when they develop. Browser compatibility issues are also a tricky problem for programmers to use to develop AJAX applications directly with JavaScript.
5. Scalability
If you think GWT's API doesn't meet your needs, you can use JSNI to embed JavaScript statements directly into Java code.
Using GWT for UI development
In this part of this article, we'll explore GWT's support for UI development. In GWT, it contains most of the components we need for web development, such as button, text box, and so on. Figure one shows some of the UI components that GWT supports. From the picture's display, you can use GWT to make a very nice UI.
Figure I: Some of the UI components that GWT supports