Currently I using ActionForm's validate method to do the validation of the form when submit.Is this the best way to do form validation?
Bellow is my validate method, but ActionError(
String)is deprecated.
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (userID == null || userID .trim().equals("")) {
errors.add("userID ",new ActionError("error.user.userID .null"));
}
return errors;
}
[ June 02, 2005: Message edited by: michelle W ]