users@jersey.java.net

Using _at_QueryParam

From: James Weir <James.Weir_at_Sun.COM>
Date: Tue, 18 Mar 2008 11:59:49 +0100

Hi,

I have a resource that will allow me to recuperate an item or query for
several items. My resource (based on the Storage Example) has the
following template:

@Path("/users/{name}/appliances/")
@ProduceMime({"application/xml", "application/json"})
@ConsumeMime({"application/xml", "application/json"})
public class MyResource {

    // GET for URI: /users/<name>/appliances?id=<appliance id>
    @GET
    public Response get(@PathParam("name") String userName,
@QueryParam("id") String applId) {
       ....
    }

     // GET for URI: /users/<name>/appliances/<id>
    @Path(value="{id}", limited=false)
    @GET
    public Response getItem(@PathParam("name") String userName,
@PathParam("id") String id) {
        ...
    }
}

However when I send a GET request:
http://127.0.0.1:9998/users/jim/appliances?id=1

I get a 404 response back (traces from client side)

11:46:03,921 DEBUG [Thread-4] (ApplianceMsg.java:UserMsg:316) - Querying
appliance tickets with uri: http://127.0.0.1:9998/users/jim/appliances?id=1
11:46:03,921 DEBUG [Thread-4] (CacheFilter.java:CacheFilter:36) -
CacheFilter.handle(http://127.0.0.1:9998/users/jim/appliances?id=1)
11:46:03,921 DEBUG [Thread-4] (CacheFilter.java:CacheFilter:61) -
CacheFilter response status....: 404

The server side code does not seem to be executed.
For the moment I cannot see what I am doing wrong here. Any ideas ?

Thanks for any help
James