Ajax and Java development made simpler, Part 3: Build UI features based on DOM, JavaScript, and JSP tag files

From: IBM developerWorks Worldwide  read times: 268


Provided by yangyi at 2008-07-27 20:03:25


Level: Intermediate

Andrei Cioroianu, Senior Java Developer and Consultant, Devsphere

22 Jul 2008

In the first part of this series, you saw how to generate JavaScript code for sending Ajax requests and processing Ajax responses. The second part showed how to create HTML forms, using conventions and JSP tag files to minimize setup and configuration. In this third part of the series, you'll learn how to develop client-side validators based on JavaScript as well as server-side validators, which are implemented as JSP tag files backing up their JavaScript counterparts. You'll also learn how to use resource-bundles that are reloaded automatically when changed, without requiring the restart of the application.

Client-side validation is useful because it can reduce or even eliminate the cases when the form is returned to the user for correcting errors. Nevertheless, the JavaScript-based validation is not sufficient because it can be bypassed if the data is submitted to the server with a program or if JavaScript is disabled in the user's browser. This article shows how to implement both client-side and server-side validation.

Creating a hierarchy of client-side validators

......

Please access the below link to view the full content.

Original link: http://www.ibm.com/developerwork...