I am submitteing a form. This form provides check
boxes for multiple selections. I am not using the
validation.xml to validate if "none" is selected. Instead, I am going to use the validate().
1. Do I write this validate() in the form class that
extends the ActionForm?
Yes
2. how do I write this validate() method?
However you want to. Examine the fields of your form class for whatever validity rules your application requires. If any rule is violated, add an appropriate error message into the ActionErrors message. Specifically for the check boxes, you can just check the length of the recipientFields array.
3. Where does this 'ae' return to?
The ActionErrors object is placed in the request as an attribute with a name given in Globals.ERROR_KEY. This is where the <html:errors/> and <html:messages/> tags will look. See RequestProcessor.processValidate() for the full Java code that handles this.
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors ae = new ActionErrors();
if ????? {
ae.add( "???", new ActionError("a lable that
will be inserted into the application.properties
file"));
}
return ae;
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]