Ginn, Timothy D Mr CTR USA TRADOC USAAC wrote:
I have run into a bump in the road.  I am trying to validate a list of
Strings that contain email addresses.  I can't seem to get it to check
the emails to be a valid email using the annotation validation.
Could someone please let me know if this is possible or if I am doing
something wrong
    @Validations(
        requiredStrings = {...@requiredstringvalidator(message = "At Least
one email address is required.", trim = true)},
        emails = {...@emailvalidator(message = "Please enter a valid email
address.", type = ValidatorType.FIELD)}
    )
    public void setLdapAdmins(List<String> ldapAdmins) {
        this.ldapAdmins = ldapAdmins;
    }

ldapAdmins is a list of Strings that contain email addresses. I need to
validate that they are truly email addresses and that the fields are not
"".

AFAIK the validations will validate only a single object; I believe you'd need custom validation either via a validate() method, custom validator, etc.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to