Struts

SubFramework Validation in Struts2.0
adplus-dvertising
Previous Home Next

Introduction:

Validation subfranework is a set of predefine validations which encapsulates validation logic for common validation task. This framework consist of following components

  1. Validator: Validator are predefine classes which contends validation logic for common validation.
  2. Validation MetaData: Validation metadata is an XML file that assign a logic name to predefine.
  3. Validation mapping : Validation mapping is a XML file provide a application developer which associated action field to validator.
  4. Validation Interceptor: This interceptor is responsible for applying validation on action properties using predefine validators.

Class/Library File Descriptions:

Commonly used predefine validators:
  • required: The required validators is used to checked wither a field has some value or not. Empty string are considered value by this validators.
  • requiredstring: Same as required accept empty string are not concerned value.
  • int ,double and date: Are used to checked weather an integer, real, number or date is within range or not.
  • email: This interceptor is used to checked weather a mailed is proper formate or not.
  • URL : The url interceptor is used to checked weather a url is proper formate or not.
  • stringlength: The String length is used to checked weather length of string lies within range or not.
  • regex : The regex interceptor is used to checked value of a field using a regular expiration.
Previous Home Next