I didn't find this explicit in any version of the servlet spec,
perhaps someone can help me.  If I have a servlet that gets
a ServletOutputStream and returns data to an HTTP client how
much interaction is there between the servlet engine and the
servlet regarding HTTP compliance?

Specifically, say that there is no content length header in
the response, so it therefore requires the use of chunked
transfer encoding (see the HTTP/1.1 spec).  Is the servlet
responsibile for doing the chunking (I would guess not), or
does the servlet engine have to do this?  Since the
ServletOutputStream.flush() method must write directly to
the client [1] I suppose my servlet engine needs something
like a ChunkTranferEncodingOutputStream that the
ServletOutputStream wraps around.

Thanks

Howard.

[1] In the servlet 2.1a spec on page 40 it says that "when a
    flush or close method is called on an implementation of
    this interface, any data buffered by the servlet engine
    is sent to the client..."

    The servlet 2.2 draft doesn't have the equivalent since
    it doesn't describe anything more than the signatures of
    the ServletOutputStream methods.  The JavaDoc for the
    2.2 spec on the web, doesn't mention it either (since
    flush in inherited). In section 8.1 the 2.2 spec talks
    about buffering and how it's moved the the
    ServletResponse and that "the flushBuffer method forces
    any content in the buffer to be written to the client".
    But no place I can find describes the semantics of
    calling flush() on the ServletOutputStream.  In section
    8.3 it refers to the "flush method of the
    ServletResponse interface", I assume this should be the
    "flushBuffer" method.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to