users@jersey.java.net

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

From: Cagatay Kavukcuoglu <cagatay_at_kavukcuoglu.org>
Date: Thu, 25 Aug 2011 18:05:20 -0400

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.