Wednesday, October 2, 2013

Grails validate email address

you can use

import org.apache.commons.validator.EmailValidator
...
EmailValidator emailValidator = EmailValidator.getInstance()
if (emailValidator.isValid(valueToTest)) ....

the apache commons validators are included with Grails so you don't need to install another plugin.

No comments:

Post a Comment