users@jersey.java.net

Using MessageBodyWriters as Providers for an AccountList and an Account object

From: John O'Conner <john_at_joconner.com>
Date: Fri, 31 Oct 2008 00:57:39 -0700

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) {