What happens when Bean Validation fails in a JAX-RS application?

The framework throws javax.validation.ValidationException or its subclass exceptions, such as javax.validation.ConstraintViolationException, when the Bean Validation rules that you set on the model class fails at runtime. The JAX-RS runtime will report the validation error back to the client with a 500 (internal server error) HTTP status code. You can override the default validation exception handling by providing a custom javax.ws.rs.ext.ExceptionMapper class. We discussed ExceptionMapper a while ago in the Mapping exceptions to the response message using ExceptionMapper section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.41.205