I john,
I 'm not sure there's some kind of preferred pattern for that, you should
decide what you like best...
The way we do it here is to always have the plural serve the list
(/accounts) and the singular allow access to the resource ( /account/{id} )
which forces you to write 2 different classes but makes sense.
Christian
2008/10/9 John O'Conner <john_at_joconner.com>
> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>