Bean validations (jsr 303) with jax-rs / resteasy

resteasy's suggestion for validation is to use the @ValidateRequest annotation in your jax-rs resource:

 @Path("resourcePath") @ValidateRequest public interface Resource { @POST @Path("insert") public String insert(@Valid FormBean form); } 

But this one associates your code with a specific jax-rs implementation , which I would like to avoid. Is there a general way to use JSR 303 annotations to validate incoming data?

+4
source share
1 answer

Try jcabi-aspects , which implements JSR-303 using AspectJ. It should be easy to use in combination with JAX-RS.

0
source

Source: https://habr.com/ru/post/1446021/


All Articles