You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Greg Akins <an...@gmail.com> on 2010/12/13 18:10:53 UTC

EmailValidator

I just tried to use angrygreg+xxx@gmail.com as an email , and the
Struts EmailValidator doesn't like it (Struts 2.2.1)

I'm not that great at reading regexp.. it looks like maybe the regexp
should support that email address.. but I'm not sure.

Can anyone comment on whether EmailValidator is the best approach?

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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


Re: EmailValidator

Posted by Brian Thompson <el...@gmail.com>.
TBF, it was a really old version of XWork.  It was addressed and made more
complicated in the most recent version at the time I looked into it (still
not *fixed*, though ... everyone knows how to validate an email address
until they actually read the RFCs!).

-Brian



On Mon, Dec 13, 2010 at 1:00 PM, Greg Akins <an...@gmail.com> wrote:

> On Mon, Dec 13, 2010 at 1:50 PM, Brian Thompson <el...@gmail.com>
> wrote:
> > I've looked into this before.  The email validator resolved down to some
> > really old code in XWork with a regex that looked something like this:
> >
> > [a-z0-9_]@[a-z0-9].[a-z]^3
>
> Thanks.. I hadn't looked at the source.. It looks like the API docs
> don't quite match the source then, either.
> --
> Greg Akins
>
> http://insomnia-consulting.org
> http://www.pghcodingdojo.org
> http://pittjug.dev.java.net
> http://twitter.com/akinsgre
> http://www.linkedin.com/in/akinsgre
>

Re: EmailValidator

Posted by Greg Akins <an...@gmail.com>.
On Mon, Dec 13, 2010 at 1:50 PM, Brian Thompson <el...@gmail.com> wrote:
> I've looked into this before.  The email validator resolved down to some
> really old code in XWork with a regex that looked something like this:
>
> [a-z0-9_]@[a-z0-9].[a-z]^3

Thanks.. I hadn't looked at the source.. It looks like the API docs
don't quite match the source then, either.
-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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


Re: EmailValidator

Posted by Brian Thompson <el...@gmail.com>.
I've looked into this before.  The email validator resolved down to some
really old code in XWork with a regex that looked something like this:

[a-z0-9_]@[a-z0-9].[a-z]^3

I strongly agree with Dave's advice.  Broken email validators are too common
on the web.

-Brian


On Mon, Dec 13, 2010 at 11:20 AM, Dave Newton <da...@gmail.com> wrote:

> IIRC the default email validator isn't as robust as the page- long RFC
> email
> regex. I'd suggest either a patch, ora custom validator.
>
> Dave
>  On Dec 13, 2010 12:11 PM, "Greg Akins" <an...@gmail.com> wrote:
> > I just tried to use angrygreg+xxx@gmail.com <an...@gmail.com><
> angrygreg%2Bxxx@gmail.com <an...@gmail.com>> as
> an email , and the
> > Struts EmailValidator doesn't like it (Struts 2.2.1)
> >
> > I'm not that great at reading regexp.. it looks like maybe the regexp
> > should support that email address.. but I'm not sure.
> >
> > Can anyone comment on whether EmailValidator is the best approach?
> >
> > --
> > Greg Akins
> >
> > http://insomnia-consulting.org
> > http://www.pghcodingdojo.org
> > http://pittjug.dev.java.net
> > http://twitter.com/akinsgre
> > http://www.linkedin.com/in/akinsgre
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>

Re: EmailValidator

Posted by Greg Akins <an...@gmail.com>.
On Mon, Dec 13, 2010 at 12:20 PM, Dave Newton <da...@gmail.com> wrote:
> IIRC the default email validator isn't as robust as the page- long RFC email
> regex. I'd suggest either a patch, ora custom validator.
>

Thanks.  I'll try to submit a patch after I get something more robust working

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


Re: EmailValidator

Posted by Dave Newton <da...@gmail.com>.
IIRC the default email validator isn't as robust as the page- long RFC email
regex. I'd suggest either a patch, ora custom validator.

Dave
 On Dec 13, 2010 12:11 PM, "Greg Akins" <an...@gmail.com> wrote:
> I just tried to use angrygreg+xxx@gmail.com <an...@gmail.com> as
an email , and the
> Struts EmailValidator doesn't like it (Struts 2.2.1)
>
> I'm not that great at reading regexp.. it looks like maybe the regexp
> should support that email address.. but I'm not sure.
>
> Can anyone comment on whether EmailValidator is the best approach?
>
> --
> Greg Akins
>
> http://insomnia-consulting.org
> http://www.pghcodingdojo.org
> http://pittjug.dev.java.net
> http://twitter.com/akinsgre
> http://www.linkedin.com/in/akinsgre
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>