OutputStream
can be acquired via this interface which can be used to write the response body. A buffer size can be specified when acquiring the output stream which allows data to be buffered until it over flows or is flushed explicitly. This buffering allows a partially written response body to be reset. This should never allow the message body be sent if it should not be sent with the headers as of RFC 2616 rules for the presence of a message body. A message body must not be included with a HEAD request or with a 304 or a 204 response. A proper implementation of this will prevent a message body being sent if the response is to a HEAD request of if there is a 304 or 204 response code.
It is important to note that the Response
controls the processing of the HTTP pipeline. The next HTTP request is not processed until the response has been sent. To ensure that the response is sent the close
method of the response or the output stream should be used. This will notify the server to dispatch the next request in the pipeline for processing.
@author Niall Gallagher
|
|
|
|