use of org.asqatasun.webapp.command.CreateUserCommand in project Asqatasun by Asqatasun.
the class SignUpFormValidator method validate.
@Override
public void validate(Object target, Errors errors) {
boolean hasMandatoryElementWrong = false;
CreateUserCommand userSubscriptionCommand = (CreateUserCommand) target;
if (!checkSiteUrl(userSubscriptionCommand, errors)) {
hasMandatoryElementWrong = true;
}
if (!checkEmail(userSubscriptionCommand, errors)) {
hasMandatoryElementWrong = true;
}
if (!checkPassword(userSubscriptionCommand, errors)) {
hasMandatoryElementWrong = true;
}
// }
if (hasMandatoryElementWrong) {
// if no URL is filled-in
errors.rejectValue(GENERAL_ERROR_MSG_KEY, MANDATORY_FIELD_MSG_BUNDLE_KEY);
}
}
Aggregations