Problem with StreamedOutput model

From: Bill Burke <>
Date: Wed, 12 Mar 2008 19:56:36 -0400

Ok, I believe there is a problem with the streamed output model. Let's
go back to the Ajax Polling usecase where the client does a GET and
waits and waits and waits for a response. What if we want to allow the
client to specify a timeout? The StreamedOutput interface requires a
commit of the status and headers, correct? So, in our background asynch
writes, there would be no way to timeout and send back the appropriate
HTTP Response code.

Are you following me?

I guess a solution to this would be to not commit until something is
written to the OutputStream and allow a WebApplicationException to be
thrown. The same is already done for MessageBodyWriter's correct?

Bill Burke
JBoss, a division of Red Hat