users@jersey.java.net

Questions about container-item pattern

From: John O'Conner <john_at_joconner.com>
Date: Wed, 8 Oct 2008 15:03:11 -0700

Thank you in advance for being patient with a REST and Jersey noob.

I have created a root resource call AccountsResource with the
@Path("/accounts"). This class returns a list of accounts in the
system.

At this point I could create a subresource /accounts/{id} that would
retrieve information about a specific account....or I could create a
root resource called AccountResource that would always require an id,
ie /account/{id}.

What is the general pattern for handling containers and then specific
items within the container. Is /accounts/{id} correct for retrieving a
specific account...or is /account/{id} the preferred pattern?

Regards,
John