Skip to content

Commit

Permalink
Validación formato de mail
Browse files Browse the repository at this point in the history
  • Loading branch information
jencisopy committed Dec 9, 2024
1 parent 2993f1a commit 152cbac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public String getErrorMsg(IDataRow ejb) {
while (iterator.hasNext()) {
key = (String) iterator.next();
error = ejb.getErrors().get(key);
msgErrores += error.getMessage() + "-" + key + "\n";
msgErrores += error.getMessage().trim() + " - " + key + "\n";
}
return msgErrores;
}
Expand Down
5 changes: 5 additions & 0 deletions commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@
<artifactId>number2words</artifactId>
<version>0.2</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.7</version>
</dependency>
</dependencies>
</project>
5 changes: 5 additions & 0 deletions commons/src/main/java/org/javabeanstack/util/Fn.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import org.apache.commons.validator.routines.EmailValidator;

/**
* Funciones utiles
Expand Down Expand Up @@ -347,4 +348,8 @@ public static String getValueFormatted(Object value, String format) {
}
return nvl(result,"").trim();
}

public static boolean isEmailValid(String emailAdress){
return EmailValidator.getInstance().isValid(emailAdress);
}
}

0 comments on commit 152cbac

Please sign in to comment.