From: Roland Häder Date: Fri, 12 Aug 2016 10:43:12 +0000 (+0200) Subject: Continued a bit: (please cherry-pick) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0ed0d305da7a3ba06babc1a9735a9ca1d5974173;p=jjobs-war.git Continued a bit: (please cherry-pick) - please let the application and not the validator decide what to do with already registered or unregistered email addresses. - the validator should only validate (against regex) and not make sure (means control) that the valid email address is okay to use for the requested action. - else there is a double-check and the validator will come first with non-localized messages Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java b/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java index b2244a9e..fbf98ec6 100644 --- a/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java +++ b/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java @@ -92,27 +92,6 @@ public class JobsEmailAddressValidator extends BaseStringValidator implements Va // Not matching throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message)); } - - // Get client id (aka form id) - String clientId = component.getClientId(); - - // Is the email address already registered? - if ((!clientId.endsWith("resendEmailAddress")) && (this.contactBean.isEmailAddressRegistered(emailAddress))) { //NOI18N - // Generate message - String message = MessageFormat.format("Email address {0} is already registered.", emailAddress); //NOI18N - - // No, then abort here - throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); - } else if ((clientId.endsWith("resendEmailAddress")) && (!this.contactBean.isEmailAddressRegistered(emailAddress))) { //NOI18N - // Generate message - String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N - - // No, then abort here - throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); - } - - // Trace message - //* NOISY-DEBUG: */ System.out.println("validate: EXIT!"); //NOI18N } }