Discuss about Struts validation and Ajax validation.Ajax Validations :
- Real time data validation is one among the advantages in AJAX. AJAX validation makes the validators available to the application on server side which can be used without enforcing the reloading the page.
- The jsonValidation interceptor performs the validation for AJAX. When it is required to access the action directly, the normal results such as success pages should be provided for the action, which triggers the normal validation. The form will be submitted to the action if validation is success. If the request is made using AJAX, instead of a regular submit, then specify the ajaxAfterValidation attirbute to true in the submit tag.
Validators : - Validators handle native and common types. The validations for basic operations are mask, required, minLength, maxLength, native types, date, email, range etc.
Resource bundle : - These are used to provide the localized labels, messages and share by default the struts messages.
XML configuration file : - This file specifies the form set and validates for the form fields as and how needed. The validators for these files can be defined in a separate file.
JSP tag : - Used and generates the validations for a given form using the java script validations.
ValidatorForm : - Used to automatically validate the properties that is based on the form bean’s name.
ValidatorActionForm : - The validation takes place automatically on properties which is based on the action path.
|