users@jersey.java.net

[Jersey] Re: Bug in UriInfo.getMatchedURIs with trailing matrix parameters

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Mon, 05 Sep 2011 12:11:42 +0200

Hi Cagatay,

Please file a bug.

Thanks,

~Jakub

On 26.8.2011 0:05, Cagatay Kavukcuoglu wrote:
> I'm getting unexpected results from UriInfo.getMatchedURIs method when
> the request path contains trailing matrix parameters. I have a
> resource class that looks like:
>
> @Path("base")
> public class MyResource {
>
> @GET
> @Path("{name}")
> public Response topLevel(@Context UriInfo uriInfo) {
> ...
> }
> }
>
> For request "GET /base/resource;abc", UriInfo.getMatchedURIs returns
> [base/resource;abc, base/res]. I expect it to return
> [base/resource;abc, base] instead. For request "GET /base/resource" it
> returns [base/resource, base] as expected.
>
> It looks like Jersey adds as many trailing characters from the request
> path to the preceding match as we have in the trailing matrix
> parameters on the path. I tried a few different examples and this
> happens consistently. Matrix parameters in enclosed path segments seem
> to cause no problems.
>
> I'm using Jersey 1.8 and Tomcat 7.0.19. Is this a known issue that's
> fixed on trunk or should file a bug?
>
> CK.
>