GWT Bean Validation doubts

227 views
Skip to first unread message

vehdra music

unread,
Oct 18, 2012, 11:46:46 AM10/18/12
to google-we...@googlegroups.com
Hi.

I am trying to use GWT Bean Validation but I can't find in the docs wich ones are the supported annotations in client side and server side. For example I've tried to use @Email and it seems doesn't work.

So I would like to know if there some list of supported annotations.

On the other side I can't figure how can I throw custom ConstraintViolationException(s) in my ServiceImpl. 

For example I can't have 2 users with the same email. So, in my UserServiceImpl.create() method I would like to throw a ConstraintViolationException if someone tries to register with a email that is already in the database. But I can't figure how to throw a ConstraintViolationException in this case.

Alex opn

unread,
Oct 23, 2012, 3:09:36 AM10/23/12
to google-we...@googlegroups.com
*Bump*

I'd be interested in answers, too :)

Adolfo Panizo Touzon

unread,
Oct 23, 2012, 4:25:44 AM10/23/12
to google-we...@googlegroups.com
Hi,

I haven't used Bean Validation framework in the server side, I can't help you in that way. 

But about the problem of @Email it looks like you are missing the validation libraries (you have to add hibernate-validator and validation-api libraries).

I've attached two projects where you can see examples.

The second one is the official BeanValidation example (I think you can find an example for you question about throwing an exception in the server side).

The first one is one example that I've seen one day in this forum about using validation and gwt's editor framework working both at the same time (you can see the implementation of new Constraint as well). Really useful. Also, you can find the jars that you need in these project.

Hope it helps.

Adolfo.

2012/10/23 Alex opn <opn...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/VuE3B9WsKKcJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
El precio es lo que pagas. El valor es lo que recibes.
Warren Buffet



--
El precio es lo que pagas. El valor es lo que recibes.
Warren Buffet
validation.rar
TestClassLevelConstraints.rar

Drew Spencer

unread,
Oct 23, 2012, 10:29:23 AM10/23/12
to google-we...@googlegroups.com
I think we would all be very grateful for some comprehensive documentation on the use of the validation framework for the front and back ends.

Also the editor framework.

I don't get how I'm meant to build a full, complex app without understanding these features fully, and current docs are sketchy at best.

Thank heavens for TBroyer.
Reply all
Reply to author
Forward
0 new messages