]> git.mxchange.org Git - jjobs-war.git/commitdiff
Continued a bit: (please cherry-pick)
authorRoland Häder <roland@mxchange.org>
Fri, 12 Aug 2016 10:43:12 +0000 (12:43 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 19 Aug 2016 21:07:04 +0000 (23:07 +0200)
- 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 <roland@mxchange.org>
src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java

index b2244a9e117b3c53792682b8fd99db7845b5f799..fbf98ec6abebae78b9239ab05345741b588e2387 100644 (file)
@@ -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
        }
 
 }