* Validate the properties of this form bean, and return an array of
* message keys for any errors we encounter.
*/
public String[] validate() {
ErrorMessages errors = new ErrorMessages();
if ((username == null) || (username.length() < 1))
errors.addError("error.username.required");
if (!password.equals(password))
errors.addError("error.password.match");
if ((fromAddress == null) || (fromAddress.length() < 1))
errors.addError("error.fromAddress.required");
else {
int atSign = fromAddress.indexOf("@");
if ((atSign < 1) || (atSign >= (fromAddress.length() - 1)))
errors.addError("error.fromAddress.format");
}
if ((fullName == null) || (fullName.length() < 1))
errors.addError("error.fullName.required");
if ((replyToAddress != null) && (replyToAddress.length() > 0)) {
int atSign = replyToAddress.indexOf("@");
if ((atSign < 1) || (atSign >= (replyToAddress.length() - 1)))
errors.addError("error.replyToAddress.format");
}
return (errors.getErrors());
}