O'Reilly logo

Google Web Toolkit for Ajax by Bruce W. Perry

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Demo Application

Phew, now we have plowed through a lot of the details dealing with the GWT development environment. What does our application involve? We'll keep it simple but real-world, not just your garden variety "Hello World" application. Figure 6 shows the screen for the application. The user clicks the "Request Info" button, and the three text fields are filled with the server name, the time of the user's request, and the associated user-agent string (a special identifier that is associated with each browser vendor).

The screen for our demo application in Firefox

Figure 6. The screen for our demo application in Firefox

Obviously, all this information is derived from a server component—in our case, a PHP file. We also have developed a Java servlet for the same purpose, which the shortcut will show in a later section.

The application user does not experience a browser refresh; the information appears in the text boxes after a few moments. Messages appear beneath the form widgets, letting the user know the status of her button click.

Figure 7 shows the screen after the user first clicks the button. An alert box shows the server return value (useful for debugging). A message in a large, green font indicates that the form values have been submitted. This message may seem obvious, but the user is accustomed to seeing the browser page refresh or reconstitute when she submits web form values. In Ajax applications, nothing happens ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required