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

Get Google Web Toolkit for Ajax now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.