Hi,
I am trying to run the JAX-RS sample bundled in the 2.1 trunk. I am trying to
add /customers/ GET which returns all the customers under that resource. But, I
see some wierd behavior when I try to access from the browser. I added 3
customers in the init() method which populates the map once the server is
started.
Both the GET calls to /customers and /customers/1 returns 3 customer instances.
Here is my sample lookslike:
@GET
@Path("/customers/")
public Customers getCustomers() {
System.out.println("----invoking getCustomers");
Customers e = new Customers();
e.setCustomer(customers.values());
return e;
}
@GET
@Path("/customers/{id}/")
public Customer getCustomer(@UriParam("id") String id) {
System.out.println("----invoking getCustomer, Customer id is: " + id);
long idNumber = Long.parseLong(id);
Customer c = customers.get(idNumber);
return c;
}
Am I missing something?
Please clarify.
Regards
Arul