sbhavan 30 Light Poster

Hi, Everybody,

I have to write program to validate the form fields in java to validate in server side. For that I have a form base validater and in that validater is will use the generic validators like StringValidator, NumericValidator, etc. to validate the values retrieved from the form. And the data entered in the form is not valid I have to set some error message for the appropriate form fields in my form based validator and return the enter list of errors to my action class.

I will call the form based validator from my action class and if it returns any non zero length error list I have to redirect to my form and display the list of errors, and it returns a zero length error list (obviously no errors and all data entered are valid), I have to proceed further.


Please suggest me how to create the error list and return it back.

PS. The requirement is I have to use ArrayList to create the list of errors. Please help me how to set error messages in the array list for the appropriate fields and retrived it back in the form. (Like "Key" "Value" pairs).

:) Thanks in advance. :)