Chapter 12: Working with the Validator

 < Day Day Up > 



Overview

In this chapter, you learn how to use Struts to validate form fields. You will have to do the same validation in many forms—for example, a telephone number in both a user registration form and an order form. Instead of writing the phone validation twice (in each of the validate methods of the form beans corresponding to these forms), you can create a general validation mechanism for all phone numbers in the system.

The validation mechanism should have support for internationalization and be extensible. The goal of this chapter is to cover all of the required components needed to use the Validator Framework to validate your form fields. At the end of this chapter, you should feel comfortable with using the Validator Framework to validate form fields and with writing your own validation components to plug into the framework.

This chapter covers the following topics:

  • Understanding how the Validator Framework integrates with Struts

  • Using the Validator Framework with static ActionForms and with DynaActionForms

  • Working with validation rules

  • Building and using your own validation rules

  • Using the Validator Framework and your own custom validation at the same time

  • Employing JavaScript validation on the client side



 < Day Day Up > 



Professional Jakarta Struts
Professional Jakarta Struts (Programmer to Programmer)
ISBN: 0764544373
EAN: 2147483647
Year: 2003
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net