users@jersey.java.net

[Jersey] ambiguous resource method for HTTP method

From: Javi Moran <fjmoranrua_at_gmail.com>
Date: Wed, 11 Mar 2009 09:08:03 +0100

On Tue, 10 Mar 2009 18:16:43, Paul Sandoz wrote:

>> You could just add paramA and paramB to a single @GET-annotated
>> method, then call the appropriate private method.
>>

> Right.

Oks.

>It is only possible to match based on the URI path and what media type
>is produced and/or consumed.

>JAX-RS does not perform matching and method selection for query
>parameters, as this encourages an RPC-centric approach to the design
>of the application, in addition to potential ambiguities (what if
>multiple values are present, what if query param A and B are present,
>what if default values are required in absence, does the order of
>query parameters in the URI matter?)

Thank you very much (You and Jaka).Now, I get it.

The problem was that the tests I was doing were focused in order
to replicate a REST API which has been designed, after reading
your good reflections, in my opinion, not in RESTful way.
It is an API in which all the methods have the same URL base and are
distinguished by two criteria:

   * The value of the query parameter *methodName* which is always
present and receives
the name of the method to serve.
   * A variable number of paratemers according to the needs of the
methodName value.

So, instead of replicating that API, I will redesign it.

Javier Moran.