users@jersey.java.net

Re: Changing headers in service

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 14 Jan 2008 10:35:08 -0500

No need to use servlet specific stuff, instead you need to return an
instance of Response from your method, e.g.:

@GET
Response someMethod() {
   ...
   return Response.ok().header(name, value).build();
}

On Jan 14, 2008, at 10:12 AM, Christian wrote:

> Hi
> I cannot figure how to add a response header to the response when
> running in a servlet container ?
> Should I try to have some HttpServletResponse injected in my
> service ? I can't figure how to do this
>
> Thanks in advance
> ,
>
> Christian

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.