users@jersey.java.net

Re: [Jersey] Uri matching

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 26 Feb 2009 17:16:25 +0100

On Feb 26, 2009, at 5:13 PM, António Mota wrote:

> I have a slightly different scenario. I have
>
> 1) @GET
> @Path("/data/{key}")
> String read(@PathParam("key")String key);
>
> 2) @GET
> @Path("/data/{key}")
> String read(@PathParam("key")String key,
> @QueryParam("mode")boolean mode);
>
> How do I make to
>
> /data/10001 -> match 1)
>
> /data/10001?mode=xxx -> match 2)
>
> Should I also use reegex?

You cannot match on query strings. It is only possible to match on the
URI path and the consumed/produced media types.

Paul.