On Tue, Jul 30, 2013 at 7:39 AM, Jakub Podlesak
<jakub.podlesak_at_oracle.com>wrote:
> Hi Nick,
>
> Cam is right, JAX-RS dispatch algorithm could not tell which
> resource method to invoke.
>
> What you can do instead is something like:
>
> @GET
> @Produces({MediaType.APPLICATION_JSON})
> public List<Wine> findByName(@QueryParam("name") String name) {
> if (name != null) {
> return findByName(name);
> } else {
> return findAll();
> }
>
> // removed JAX-RS annotations
> public List<Wine> findAll() {…}
>
> @Path("{id}")
> @GET
> @Produces(MediaType.APPLICATION_JSON)
> public Wine findById(@PathParam("id") String id) {
> …
> }
>
> HTH,
>
> ~Jakub
>
>
>
Hello Guys,
Thank you so much for your response. Not sure how elegant this hack would
be as we keep adding search
criteria, (ie, search by type, region, date, etc...). Is there a better
solution? The bug in the dispatching algorithm
is a WONTFIX?
Kind Regards,
Nick.