Building AJAX applications with Google Web Toolkit, Apache Derby, and Eclipse 1

Source: Internet
Author: User
Tags html page mail

GWT makes it easier to build a rich Ajax browser client interface than to build a traditional Java GUI interface. However, even a good technology like GWT cannot build a complete WEB application on its own. You must also have a data store on the server and a type of framework to convert the data into a Java object that GWT can pass to its customers from the server. In this series of articles, you will use Apache Derby, the 100% pure Java database, to embed it in the same Java Virtual machine (JVM) as the rest of the server-side code.

The first article in this series focuses on GWT. Here you will learn how to set up GWT and create a simple client interface to respond to user actions. Later articles will show you how to set up the Derby database and connect your GWT front-end to a derby-based backend. Ultimately, you will learn how to deploy your system outside of your development environment.

What is Google Web Toolkit?

With GWT, you can use the Java programming language to develop AJAX applications. Ajax applications are characterized by rich, interactive environments that are often associated with traditional UI applications. Figure 1 shows a sample GWT interface that mimics the desktop e-mail application. This demo can be seen on GWT's Web site.

Figure 1. GWT e-Mail Demo

The most unique feature of GWT is that you can create Ajax applications while still writing code in the Java language. You can use your favorite Java integrated development environment (IDE), and the better thing is that you can also debug your clients in the Java IDE. You can use Java objects to communicate between the client and the server, which is much lighter in the client than when using Java applets.

Basically, GWT is a compiler. It translates the Java code you write into JavaScript code, which is then inserted into the HTML page and used by the client running the application. This feature allows you to avoid the minutiae of supporting JavaScript code on multiple browsers, allowing you to focus on the interface and interaction of your program.

Of course, if the compiler is the only feature that GWT offers, it won't be too exciting. Luckily, it has brought us more than that. With GWT, the compiler is simply a mechanism for delivering the entire client/server application architecture. The features include:

A standard set of UI widgets (widgets) that look good, have high flexibility, and are tuned to work in all major browsers, including Safari and Opera.

An event mechanism that captures and responds to events entirely on the client.

A framework for managing asynchronous calls between Web applications and servers.

A mechanism for creating stateful browser history so that your Ajax applications do not become cluttered by the possibility of backward (back) button behavior.

A test framework that uses JUnit to write unit tests for client applications.

This series explores the majority of the above features. But first please download and install GWT.

Related Article

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.