Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

Email validation

Tobin Juday

2008-10-12


Author LoginPost Reply
Hi all. I noticed that the built-in Struts2 email validator is too strict
with characters it allowd. In my case, it was preventing me from using
Gmail's trick with the plus sign.
(If I have the email address h4x0r@(protected)
additional text, and it all gets "forwarded" to my example account. So,
h4x0r+1@(protected)>,
h4x0r+no_spam@gmail.com<h4x0r%2Bno_spam@(protected)>
, h4x0r+struts2@(protected)
h4x0r@(protected).)

Unfortunately, the email validator only allows letters, numbers, '.', '-',
and '_'. I went ahead and substituted a new regex in the <param> element
in my validator.xml, but I think we should expand the allowable characters
in the default pattern.

Here's a useful post I found regarding the issue:
http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx

Thoughts?

Tobin
©2008 gg3721.com - Jax Systems, LLC, U.S.A.