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]

Build an Ajax-enabled application using the Google Web Toolkit and Apache Geronimo, Part 1: Run compiled Google Web Toolkit applications on Geronimo

Michael Galpin, Developer, Adomo, Inc.
Michael Galpin's photo
Michael Galpin has been developing Java software professionally since 1998. He holds a degree in mathematics from the California Institute of Technology and currently works at Adomo, Inc.

Summary:  Asynchronous Java™Script + XML (Ajax)-enabled Web applications have taken the software development world by storm. Some of the most notable ones have been built by Google. This two-part tutorial series shows you how the Google Web Toolkit (GWT) and Apache Geronimo can help you rapidly build sophisticated Ajax Web applications—without having to write any JavaServer Pages (JSP) components, servlets, or JavaScript.

View more content in this series

Date:  08 May 2007
Level:  Intermediate PDF:  A4 and Letter (906 KB | 36 pages)Get Adobe® Reader®

Activity:  14484 views
Comments:  

Before you start

This tutorial, the first in a two-part series, is for Java developers who want to create Ajax-enabled Web applications and learn about the GWT and Apache Geronimo.

About this series

Ajax-enabled Web applications have become incredibly popular recently. Ajax makes Web applications behave a lot like desktop applications. They offer greater interactivity and functionality than the previous generation of Web applications. And Geronimo provides the perfect platform for building Ajax-enabled Web applications.

However, building Ajax-enabled Web applications is more difficult than building traditional Web applications. It involves lots of JavaScript and Dynamic HTML (DHTML) development. Quirks among different browsers—and even different versions of the same browser—further complicate things. The GWT is one of many Ajax frameworks that makes your job easier by using a novel approach that lets you write all of your code in the Java language and generates all the JavaScript for you. The two tutorials in this series cover the following topics:

  • Part 1 focuses on getting started with GWT and creating a simple Ajax-enabled Web application for retrieving stock quotes.
  • Part 2 shows you how to make the stock quotes application more sophisticated and how to transform it into a stock portfolio application, leveraging both GWT and Geronimo.

About this tutorial

Check out the Ajax Resource Center, your one-stop shop for information on the Ajax programming model, including articles and tutorials, discussion forums, blogs, wikis, events, and news. If it's happening, it's covered here.

In this tutorial, you build an Ajax-enabled Web application using the GWT and find out how easy it is to develop GWT applications and deploy them using Geronimo.

This tutorial covers:

  • Installing GWT.
  • Using GWT's command-line tools.
  • Programmatic UI development using GWT's widgets.
  • Creating an Ajax-enabled service called by your Web application.
  • Building and deploying the application using Geronimo.

Prerequisites

This tutorial is about building a Java Web application, but you'll only need to understand the basics of Java servlets. GWT leverages many ideas common to other technologies, such as layout management, event systems, and remote procedural calls (RPCs), so prior exposure to these ideas makes it easy to master GWT. You'll also work with the Geronimo Console, HTML, and cascading style sheets (CSS), so some familiarity with these tools is helpful.

System requirements

You need the following software to set up your development environment before getting started:

  • Geronimo 2.0 with Tomcat — The sample Web application in this tutorial was built using Geronimo with Tomcat, but it should also work with Geronimo with Jetty, because everything is standard Java Platform, Enterprise Edition (Java EE). This tutorial uses Geronimo 2.0 (M3) but should work with older versions of Geronimo as well.
  • Java 5 or Java 6 — The sample Web application uses generics and annotations. It was developed using Java 6, but also tested against Java 5.
  • Apache Jakarta implementation of JSTL 1.1 — Geronimo 1.1 is a certified J2EE 1.4 implementation, so you need to use JSTL 1.1.
  • Google Web Toolkit — This tutorial is all about the GWT; download GWT 1.3.3 for this tutorial.
  • Eclipse — The sample Web application is built using Eclipse, as you'll see from the screen captures. GWT includes a convenient command-line tool for creating a skeleton Eclipse project. It's not hard to build GWT applications without Eclipse, but Eclipse provides a great debugger to debug your GWT application.

Install GWT

To get started with GWT, you first need to install it. When you go to the GWT download page, it presents you with a GWT distribution that is specific to your operating system. That's because GWT includes several command-line executables for generating artifacts needed for your application. Some of the artifacts that it creates include executables for running the GWT Java-to-JavaScript compiler and for running your application in hosted mode.

After you've downloaded GWT, extract it and navigate to the directory where you extracted it. You should see files similar to those in Figure 1.


Figure 1. GWT installation directory
GWT installation directory

Notice the executable files, such as applicationCreator.cmd and projectCreator.cmd. You use these to generate your application and an Eclipse project for your application. You might also want to create an environment variable — GWT_HOME for example. The tutorial refers to this variable.

That's all there is to installing GWT! No installers to run or anything like that. Just extract the archive, and you're ready to start building a Web application using GWT.

1 of 9 | 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=Open source, Web development, WebSphere
ArticleID=218651
TutorialTitle=Build an Ajax-enabled application using the Google Web Toolkit and Apache Geronimo, Part 1: Run compiled Google Web Toolkit applications on Geronimo
publish-date=05082007
author1-email=mike.sr@gmail.com
author1-email-cc=

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).

Try IBM PureSystems. No charge.