users@jersey.java.net

Re: accessing response

From: Jon Iantosca <digester_at_gmail.com>
Date: Thu, 5 Nov 2009 11:37:14 -0500

Hope I didn't waste anyone's time! I just came across the interfaces
ContainerResponseFilter, and ContainerRequestFilter. But of course I'm all
ears for any additional suggestions.

On Thu, Nov 5, 2009 at 10:58 AM, Jon Iantosca <digester_at_gmail.com> wrote:

> Howdy - I'm hoping someone can point me in the direction of how to go about
> accessing my restful responses. More specifically, I'd like access to the
> serialized response after my resource method has executed, but before it's
> written out to the client. My resource methods typically resemble the sample
> code below, producing both xml and json, but I'm hoping to find a solution
> that doesn't care about what's being returned. I'm hoping I can perhaps
> register something like an "about to send a response" kind of listener. Can
> someone point me int he right direction here?
>
> @GET
> @Produces({"application/xml", "application/json"})
> @Path( "account/{number}" )
> public Portfolio getSummary( @PathParam("number") String number ) {
> AccountDelegate delegate = new AccountDelegate( number );
> return delegate.getSummary();
> }
>