This quick and simple guide will walk you through the steps to validate JAX-RS query parameters using filters, including their creation and enforcement.

Join the DZone community and get the full member experience.

It’s easy to validate parameters in JAX-RS using filters – ContainerRequestFilter to be specific. There are other options at your disposal, e.g. using (CDI or EJB) interceptors, or injecting ( HttpServletRequest using @Context )

Published at DZone with permission of Abhishek Gupta , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.