Hi,
What's the standard way to validate request parameters with GWTP?
1. ActionException (with cause erased) when I do -
throw new ActionException("Constraint violations found.", new ConstraintViolationException(violationSet));
OR
2. ServiceException (with cause erased) when I do -
throw new ConstraintViolationException(violationSet);
I even tried creating a custom exception which extends ActionException.
public class ConstraintViolationActionException extends ActionException implements IsSerializable {
private Set<ConstraintViolation<?>> violations;
// getters and setters
}
With this, I get a StatusCodeException back because of serialization error:
com.google.gwt.user.client.rpc.SerializationException: Type 'org.hibernate.validator.internal.engine.ConstraintViolationImpl' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = ConstraintViolationImpl{interpolatedMessage='may not be null', propertyPath=ownerKey, rootBeanClass=class x.y.z.SomeClass, messageTemplate='{javax.validation.constraints.NotNull.message}'}
How is above class not Serializable when it works with GWT RF and RPC?
The problem here is that I'm not able to find out any constraint violations on client. I've no idea how validation works with GWTP and I couldn't find anything on github wiki. Any guidance is helpful.
Thanks.