30.4 Adding Ajax Functionality to the Validation App

The example in this section adds Ajax capabilities to the Validation app that we presented in Section 29.7. Figure 30.11 shows the sample outputs from the ValidationAjax version of the app that we’ll build momentarily. Part (a) shows the initial form that’s displayed when this app first executes. Parts (b) and (c) show validation errors that are displayed when the user submits an empty form and invalid data, respectively. Part (d) shows the page after the form is submitted successfully.

As you can see, the app has the same functionality as the version in Section 29.7; however, you’ll notice a couple of changes in how the app works. First, the URL displayed in the web browser always reads ...

Get Java How to Program (early objects), 9/e 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.