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 google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment