Paul, Marc,
thanks for all the in-depth answers!
> 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(
> @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();
> }
>
Hmmm - I guess I can just implement StreamingOutput and do this:
> public Response getResource(
> @PathParam("id") String id
> ) {
>
> MyDomainObjectStreamer domainStreamer = new
> MyDomainObjectStreamer(-my special params go here-);
> return Response.ok(domainStreamer).header(a,b).header(c,d).build();
> }
Thanks!!
Jan
> Marc.