Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Use XML to develop with the Google Web Toolkit

Build easy Ajax applications with the help of XML

Tyler Anderson received both his B.S. in Computer Science in 2004 and his M.S. in Electrical and Computer Engineering in 2005 from Brigham Young University. Tyler has worked with Stexar Corporation as a Design Engineer, R&D, since May 2005 to August 2006 when Stexar died. Since Tyler was discovered by Backstop Media LLC in early 2005 he has written and coded numerous articles and tutorials for IBM developerWorks and DevX.
Nicholas Chase has been involved in Web site development for companies such as Lucent Technologies, Sun Microsystems, Oracle, and the Tampa Bay Buccaneers. Nick has been a high school physics teacher, a low-level radioactive waste facility manager, an online science fiction magazine editor, a multimedia engineer, and an Oracle instructor. More recently, he was the Chief Technology Officer of Site Dynamics Interactive Communications in Clearwater, Florida, USA, and is the author of three books on Web development, including Java and XML From Scratch (Que) and the upcoming Primer Plus XML Programming (Sams). He loves to hear from readers and can be reached at nicholas@nicholaschase.com.

Summary:  The Google Web Toolkit enables you to use Java™ syntax to create the JavaScript™ necessary for Asynchronous JavaScript + XML (Ajax) user interfaces. 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 manipulate and create XML using the Google Web Toolkit.

Date:  10 Apr 2007
Level:  Intermediate PDF:  A4 and Letter (3134 KB | 52 pages)Get Adobe® Reader®

Activity:  21493 views
Comments:  

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.

What is this tutorial about?

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.


Prerequisites

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.

1 of 12 | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=XML, Web development, Java technology
ArticleID=207140
TutorialTitle=Use XML to develop with the Google Web Toolkit
publish-date=04102007
author1-email=tyleranderson5@yahoo.com
author1-email-cc=dwxed@us.ibm.com
author2-email=ibmquestions@nicholaschase.com
author2-email-cc=dwxed@us.ibm.com

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Special offers