Re: JSR311: Problem with StreamedOutput model

From: Bill Burke <>
Date: Fri, 14 Mar 2008 09:37:02 -0400

Stephan Koops wrote:
> Hello Bill,
> why must the MessageBodyWriter (or the StreamingOutput) blocks, why not
> the resource method?
> This brings application logic in the MessageBodyWriter. But this is not
> the business of the MessageBodyWriter, as its name says.

Its not application logic, its marshalling logic. At least for
MessageBodyWriter. If the app developer has constructed its object
erroneously, there's no way to flag this if the response codes have been
committed. But...I was thinking more of StreamedOutput.

> If the resource method blocks, than it is also not necessary, that the
> MessageBodyWriter throws Exceptions or changes HTTP headers.

Take a look at the Comet stuff Jerome linked, and you'll see what I mean.


Bill Burke
JBoss, a division of Red Hat