Hello group. I use request factory to transfer entity, from client side to server site. Transfered entity should be validate and persisted. For entity validation I use JSR303 validation. But in different cases I need to validate different properties of the entity. JSR303 validation give opportunity to use groups to make partial validation on the object.
https://gist.github.com/816186<http://www.google.com/url?sa=D&q=https%3A%2F%2Fgist.github.com%2F816186> I make a little exploration, on how the bean validation is performed by request factory servlet. I found that validation for each received object is performed by SimpleRequestProcessor on line 527. I use GWT-2.1.1 version. This code: 519: private List<ViolationMessage> validateEntities(RequestState source) { 520: List<ViolationMessage> errorMessages = new ArrayList<ViolationMessage>(); 521: for (Map.Entry<SimpleProxyId<?>, AutoBean<? extends BaseProxy>> entry : source.beans.entrySet()) { 522: AutoBean<? extends BaseProxy> bean = entry.getValue(); 523: Object domainObject = bean.getTag(Constants.DOMAIN_OBJECT); 524: 525: // The object could have been deleted 526: if (domainObject != null) { 527: Set<ConstraintViolation<Object>> errors = service.validate(domainObject); 528: if (errors != null && !errors.isEmpty()) { 529: SimpleProxyId<?> id = entry.getKey(); RequestFactory allways use default group to make validation. Is there any way to make partial validation on a bean, by using groups? Any workaround? Any idea? Is there any way for validation groups to be implemented in gwt request factory in the future? Maybe the validation group (or group sequences) to be defined, before firing request? Example: Request<MyProxy> request = RequestFactory.getMyProxyRequest(); request.checkGroup(MyGroup.class).fire(new Receiver<MyProxy>(){...} -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
