Hi,
I am just searching for a good tutorial for Struts Validator.
If you guys know of any good tutorial on struts validator framework do let me know.
Thanks in advance
fldrice
Hi,
I am just searching for a good tutorial for Struts Validator.
If you guys know of any good tutorial on struts validator framework do let me know.
Thanks in advance
fldrice
Validators: Introducing Struts Validator Framework
Validation is an important part of many web applications. Input can be validated on the client side or the server side. The Validator framework can be used to simplify input validations on both sides.
Client side validation is the holy grail of web development. Any web application that does not utilize forms to gather user information would be a rarity. For a developer, web forms are synonymous with input validation. The process of validating the input can be carried out at two places -- either at the client side or at the server-side.
Server-side validation is not a popular choice in many situations due to the round trip factor. That means the data is validated at server-side and the result is sent to the client. So just to validate, an extra request-response cycle is required. Hence, client-side validation is preferred over server-side validation.
Struts Validator Framework Tutorial with Example
The Validator framework was developed by David Winterfeldt as third-party add-on to Struts. Now the Validator framework is a part of Jakarta Commons project and it can be used with or without Struts. The Validator framework comes integrated with the Struts Framework and can be used without doing any extra settings.
Using Validator Framework
Validator uses the XML file to pickup the validation rules to be applied to an form. In XML validation requirements are defined applied to a form. In case we need special validation rules not provided by the validator framework, we can plug in our own custom validations into Validator.
The Validator Framework uses two XML configuration files validator-rules.xml and validation.xml. The validator-rules.xml defines the standard validation routines, these are reusable and used in validation.xml. to define the form specific validations. The validation.xml defines the validations applied to a form bean.
Bookmarks