dev@jersey.java.net

Direct OutputStream access

From: Frank Martínez <fmartinez_at_asimovt.com>
Date: Fri, 31 Aug 2007 16:46:57 -0500

Hi all guys,

I think this is a good work based on a good specification.
I was working on a propietary rest framework by the last 3 weeks, and
then i found jsr311 and this project. I want to use this framework
instead of develop the propietary ones, but there is one thing i wish
in a rest framework, and is the ability to access the
HttpServletResponse's OutputStream directly in some circumstances.

For example:
I have developed a tool that takes a hierarchical sql query (String)
and an OutputStream and then executes the query and produces an xml
output directly to the passed OutputStream. So I dont want to
transform the SQL results in a graph of java objects and then
serialize this again into xml using an EntityProvider .... and I dont
want to get this result in a String and then return this string
because it is not as good as the direct OutputStream writing (With
large xml results)

What do you think about that?
Maybe if were possible to pass the output stream as an annotated
method parameter like:

@HttpMethod("GET")
public void getParts(@Output OutputStream out, ...) {
  .....
}

Or something like that.


-- 
Frank D. Martínez M.
Asimov Technologies Ltda.