2014-04-10 23:23 GMT+02:00 Raul Acevedo <[email protected]>: > On 2014-04-10 12:49, Jose María Zaragoza wrote: > >> According http://cxf.apache.org/docs/validationfeature.html. exception >> should be >> javax.validation.ConstraintViolationException or >> javax.validation.ValidationException >> >> How are you setting up Bean Validation feature ? > > > I'm still trying to set it up, but that's not the problem. I'm still trying > to customize the response when CXF converts arguments to the native Java > types; this isn't done by bean validation. Per my original example: >
OK. I understand I'm reading http://cxf.apache.org/docs/jax-rs-basics.html , in "Dealing with Parameters" I don't know , but maybe you need to wrapper the parameters into a BeanParam https://jax-rs-spec.java.net/nonav/2.0/apidocs/javax/ws/rs/BeanParam.html But I guess you will need to declare parameters as String and apply validation to them ( number format ) But I'm not sure Maybe , in this case, bean validation works > @GET @PATH("/{foo}/{bar}") > public Response foo(@PathParam("foo") Integer foo, @PathParam("bar") > Integer bar) { > ... do stuff ... > } > > No bean validation is used here, this is just basic input parameter binding. > CXF throws a fairly generic ClientErrorException, which doesn't tell me that > the problem is that input binding failed. > > Ideally I'd like a solution that works for both bean validation (once I get > that working) and input binding, but for now I don't see a way to do even > the basic input binding error response handler. > > Thanks, > > Raul
