-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: @Email works for a set of email addresses?
PostPosted: Sat Apr 24, 2010 6:10 pm 
Regular
Regular

Joined: Tue Feb 17, 2009 3:36 pm
Posts: 78
From the documentation, the @Email only works for a single email address. If that is true, what is recommended approach for multiple email addresses validation?


Top
 Profile  
 
 Post subject: Re: @Email works for a set of email addresses?
PostPosted: Sun Apr 25, 2010 5:59 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi,

yep, @Email works only for elements of type String, not for Collection<String> etc. We're discussing how constraints could be applied to the elements of collections, have a look here:

http://opensource.atlassian.com/project ... e/BVAL-202
http://opensource.atlassian.com/project ... wse/HV-296

but so far there is nothing implemented yet. I'd suggest to create a new type EMailAddress and validate collections of this using @Valid as described here:

viewtopic.php?f=26&t=1000608

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
 Post subject: Re: @Email works for a set of email addresses?
PostPosted: Sun Apr 25, 2010 1:31 pm 
Regular
Regular

Joined: Tue Feb 17, 2009 3:36 pm
Posts: 78
Thanks Gunar for your information.

I have a Java bean form mapped to a form directly. Since an input field can't directly mapping to a List type, I need to create another form bean instead. In the other words, I need to have other two Java class to solve this problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.