Wednesday, March 27, 2013

Handling Violations controlled by groups or Violations not found by default validation

I'm using GWT 2.5.0 and Request Factory.

I have configured a constraint to only apply on create (initial save) of my object.

This violation is not picked up by the default gwt request factory violation check mechanism - which kind of makes sense I guess, because it's in a group (I assume).

But it is thrown when I actually call my method.

So then what happens is that the violation exception is picked up as a server failure and not as a violation exception.

This is because in the SimpleRequestProcessor and method void process(RequestMessage req, ResponseMessage resp). The check violations is called before the method is invoked. This is fine, except that because my violation is in a group and I've configured it via this group to only apply on create the violation is not picked up. It is only picked up when the actually method is called.

And there is no check to see if the _method_ throws a violation exception and then to deal with any violation exceptions actually thrown by my method...

Would it not be possible to add a try catch around my method being called and dealing with these violations the same as the "normal" violation exceptions?

Or maybe somebody can tell me how to configure the gwt request processing to handle these violation exceptions and send them to the client as violation exceptions?

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment