users@jersey.java.net

[Jersey] Re: required query parameters

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Sun, 27 Jan 2013 21:50:38 -0800

On Sun, Jan 27, 2013 at 12:08 PM, morten lynge <mortenlynge_at_gmail.com> wrote:
> Hi,
>
> I've been using the Jersey implementation recently, but was a bit baffled about the fact that you cannot express required query parameters. I read lots of entries on various forums - the matter has been discussed, but not implemented. I think Jersey should have this functionality by default. I have a solution at http://developcorner.blogspot.dk/2013/01/custom-wadl-generator-in-jersey.html, but maybe there is a reason why the functionality never made it into Jersey?

Probably because validation could be considered orthogonal feature,
best handled with Bean Validation API.
And then question is that of hooking up service to invoke validator,
something that I think JAX-RS 2.0 may have.
But query parameters are bit problematic, mostly wrt how they would
tie together with payload (POST content, although GET may have one as
well), or with header parameters.

-+ Tatu +-