users@jersey.java.net

[Jersey] Media type extensions not working with PathParams

From: Dário Abdulrehman <dario.rehman_at_gmail.com>
Date: Wed, 17 Feb 2010 22:31:54 +0000

The first of the following methods works fine when I invoke it with the
Media Type extensions (.json, .rdf) i.e. GET
/resource.json?tf=abc&search_type=xpto
but the second returns a resource not found if I invoke it like GET
/resource.json/abc/def;search_type=xpto
The second only works without the .json extension

Any idea why this is happening?

Thanks.

    @GET
    @Produces({MediaType.APPLICATION_JSON,
MediaTypeExt.APPLICATION_RDF_XML})
    public Response doGet(@Context Request req,
            @QueryParam("tf") List<String> tfs, @QueryParam("search_type")
String searchType) throws Exception {

    @GET @Path("{tf : .+}")
    @Produces({MediaType.APPLICATION_JSON,
MediaTypeExt.APPLICATION_RDF_XML})
    public Response doGet2(@Context Request req,
            @PathParam("tf" List<PathSegment> tfs,
@MatrixParam("search_type") String searchType) throws Exception {