Before you start
In the past couple of years, Ajax has practically become a requirement for new Web sites, but that doesn't make it any easier to create. To create Ajax-enabled sites manually means that you create JavaScript to make asynchronous HTTP requests using objects that do not comply with browser standards, which can make for a very long programming day. The Google Web Toolkit (GWT) abstracts the JavaScript tasks necessary for an Ajax-enabled application into a few Java classes, to make creating these interfaces much more intuitive for Java programmers. But most of these Ajax applications use XML to transfer information to and from the server, so your application must be able to both parse and create XML data. This tutorial shows you how to send, receive, manipulate and create XML using the GWT.
This tutorial assumes that you're familiar with Java concepts and with HTML, although the code is fairly simple. Familiarity with XML will be helpful, but we will provide a short introduction to XML and the Document Object Model (DOM). See Resources for some links to get you started.
This tutorial explains how to use XML with the GWT, a set of Java classes designed to make the creation of Ajax-enabled Web sites easier. During the course of this tutorial, you will learn the following:
- What Ajax is
- What the GWT is
- What XML is
- What the Document Object Model (DOM) is
- How to create a GWT application
- How to retrieve an XML document using the GWT
- How to parse an XML document using the GWT
- How to manipulate a XML Document using the GWT
- How to send XML data using the GWT
In this tutorial, you will build a very small, very simple mashup application, combining information from three different sources.
To follow along with this tutorial, you will need to have the following tools installed:
- Java 2 SE 1.4 or higher: The GWT uses Java classes to generate JavaScript, so you need to be able to compile them. You can download the Java Software Development Kit.
- The GWT: The actual toolkit is available as a download from Google Code.
- WinZip or another zip utility: You will need to decompress the GWT. You can download a trial version of WinZip.
- An IDE such as Eclipse or IBM® Rational™ Web Developer will be helpful, but you can just as easily use a simple text editor to edit your files. You can download Eclipse at Eclipse.org or a trial version of Rational Web Developer.




