dev@jsr311.java.net

Re: JSR311: Response isn't adequate

From: Bill Burke <bburke_at_redhat.com>
Date: Mon, 25 Feb 2008 15:09:46 -0500

Paul Sandoz wrote:
> Bill Burke wrote:
>> It seems we have no access to an OutputStream. I can see the need for
>> wanting to stream back to the client a DB's Blob or Clob.
>>
>
> https://jsr311.dev.java.net/issues/show_bug.cgi?id=6
>
> Two workarounds:
>
> - develop a message body writer for the Blob/Clob; or
>
> - if the Blob/Clob is accessed as an InputStream one can return that.
>

This is impossible as you need to have the JDBC connection/resultset
open IIRC.

> Do you have any proposed suggestions on how to achieve the committing of
> meta-data and writing to an OutputStream?
>

Headers have to be written before data, correct? Then enforce that
ordering. IIRC, Servlet spec enforces commit errors.

meta-data a.k.a. MultivaluedMap<String, Object> can just transform on a
put, add, whatever and write directly to the response (i.e.
HttpServletResponse)

I think the Servlet spec has done a pretty good job on what the
abstraction should be. We just need to refactor HTtpServletResponse to
gut all the junk.


-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com