users@jersey.java.net

Re: [Jersey] setting cache header on GET method returning a JAXB bean

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Wed, 02 Sep 2009 15:33:23 -0400

Change the method return type to Response and use ResponseBuilder to
build the response. E.g.

@GET
Response someMethod() {
   SomeJaxbClass obj = ...
   CacheControl cc = new CacheControl();
   cc.setNoCache(true); // etc
   return Response.ok(obj).cacheControl(cc).build();
}

On Sep 2, 2009, at 3:22 PM, Moiz Dohadwala wrote:

> Hi,
>
> How does one set cache (and other ) response headers from a @GET
> method that is returning a JAXB object?
>
> Thanks,
>
> -Moiz