This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
hi, can somebody explain this using an example, "By default, any content written to the output stream is immediately sent to the client. Buffering allows content to be written before anything is actually sent back to the client, thus providing the servlet with more time to set appropriate status codes and headers or forward to another Web resource." i read this here regards, maulin.
"By default, any content written to the output stream is immediately sent to the client. As much as this stmt is true in itself, this behavior is goverened by the implementation of the App. Server. Buffering allows content to be written before anything is actually sent back to the client, thus providing the servlet with more time to set appropriate status codes and headers or forward to another Web resource." The use of the isCommitted() method will help you in deciding if the response is committed (sent to the client) or not. When the buffer size is zero (you need to set the buffer="none" in a JSP) if the page has enough content, it is committed to the client immediately since there is not place to store it. On the other hand, if a buffer is available (which is the default for most servers), the the content is stored in this buffer and is NOT committed to the client till the buffer is full. I will post the code in a second post......It is pretty big piece of code. Also I am giving you an example with JSP, which is no different thatn a servlet just that you don't have to compile and re-compile. - satya
hi satya, got it! btw, i guess if we say buffer="0kb" in page directive it is same as having no buffering and saying buffer="none". isn't it? i also read Ken's notes regarding this sendError() and sendRedirect() etc which mentions about buffering theory and how it helps... thanks maulin.