struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Leland <rlel...@apache.org>
Subject Re: email validator
Date Wed, 13 Nov 2002 18:31:57 GMT
Ricardo de Souza Moura wrote:

> I am with a problem to validate email in StrutsValidator.
> I perceived that emails with a character "-" are invalidate.
> ex:  ricardo-rj.hotmail.com.br
>
> If I try validate a field with this e-mail, it is invalidate...
>
> How can I correct this error ?

Your problem is there is no '@' ie
ricardo-rj.hotmail.com.br
               ^
Should be
ricardo-rj@hotmail.com.br

According to http://www.w3.org/Protocols/rfc822/#z51
'-' are valid. The validation is performed in 2 places.
validator-rules.xml in Javascripot and again in
org.apache.commons.validator.GenericValidator.java
seem to follow those rules closely.

-Rob



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message