users@jersey.java.net

Re: [Jersey] Using MessageBodyWriters as Providers for an AccountList and an Account object

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 31 Oct 2008 09:01:28 +0100

Hi John,

The email i received from you and the one in the archive [1] appears
to be truncated, can you resend?

Paul.

http://markmail.org/search/?q=list
%3Anet.java.dev.jersey.users#query:list%3Anet.java.dev.jersey.users
+page:1+mid:mmgnzncfqajr2dnf+state:results

On Oct 31, 2008, at 8:57 AM, John O'Conner wrote:

> Hi, I'm benefiting from all the great responses that people provide
> on this list. I hope I can provide the same one day when I become
> more skilled with this particular API. In the meantime, I have
> another question.
>
> In a nutshell, I'm able to create the summary list of "accounts" and
> return that summary as xml. However, I cannot retrieve an individual
> account. This problem appeared after I began experimenting with
> Provider annotations and MessageBodyWriter
>
> I have 4 pertinent classes:
> * AccountsResource
> * AccountsProvider
> * AccountResource
> * AccountProvider
>
> public class AccountsResource {
>
> public AccountsResource() {
>
> }
>
> @GET
> public AccountSummaryList getAccounts() {
> AccountSummaryList accountList = null;
> try {
> accountList = accountManager.getAccountSummaryList();
> } catch (AccountException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> return accountList;
> }
>
> @Path("{id}")
> public AccountResource getAccount(@PathParam("id") long id) {
>