im into a ne problem now.. i need to pass an argument value to my ReST method through my URL. But whatever i pass the server does not receive it.
@Path("/inventory") // sets the path for this service
public class InventoryResource
{
@GET // This method will process GET
// requests to the @Path value set above
@ProduceMime("text/html") // content type to output
@Path("/deviceInventory/{id}")
public Appliance getDeviceInventory(@QueryParam("id") int id)
{
System.out.println(">>>>>>>>>>>>>>> FETCHING INVENTORY <<<<<<<<<<<<<<<<<<<<<<<<< : "+id);
Appliance app = new Appliance();
//fetch the details and set it into app object.
return app;
}
}
i tried all the foll urls
http://localhost:8080/MyRestServer/rest/inventory/deviceInventory/id=25
http://localhost:8080/MyRestServer/rest/inventory/deviceInventory/25
http://localhost:8080/MyRestServer/rest/inventory/deviceInventory/id/25
but in all the case i get the server print as
>>>>>>>>>>>>>>> FETCHING INVENTORY <<<<<<<<<<<<<<<<<<<<<<<<< : 0