users@jersey.java.net

Re: [Jersey] Accessing the response object (in standard JSR311)

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 06 Oct 2009 09:05:33 -0400

On Oct 6, 2009, at 9:01 AM, Marc Hadley wrote:
>>
> If you just need to set some headers and can do so outside the
> context of the StreamingOutput#write method then this should work:
>
> public StreamingOutput getResource(

Doh. public Response getResource(

> @PathParam("id") String id
> ) {
>
> StreamingOutput strOut = new StreamingOutput() {
> public void write(OutputStream outputStream) {
> PrintWriter out = new PrintWriter(outputStream);
> out.println("Foo");
> out.close();
> } };
> return Response.ok(strOut).header(a,b).header(c,d).build();
> }
>
> Marc.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>