All, I understand that commiting the response and calling sendRedirect() will throw IllegalStateException. Is there anything in the spec about when the appserver commits the response? I know I can commit the response by calling PrintWriter.flush() or HttpServletResponse.flushBuffer(). I was under the assumption that when the buffer gets full, the appserver automatically commits the response. To test this theory, I set the buffer size to 1 using response.setBufferSize(1). After that line, I wrote couple of lines of simple output to the browser using HttpServletResponse.getWriter(). The app server didn't seem to commit automatically. Also I don't know the units for the buffer size. Are they set and get in KB? Thanks
posted 13 years ago
If you read the documentation for setBufferSize : The servlet container will use a buffer at least as large as the size requested. The actual buffer size used can be found using getBufferSize. This to me means that the server can ignore requests for setting the buffer size to too small a value. Try calling getBufferSize after your set and see what the server did set it to.
calls to getBufferSize() returns whatever I set using setBufferSize(). I also found something interesting. Call to setBufferSize(0), immediately commits response after every PrintWriter.println() statement. I am using weblogic server 6.1 [ April 24, 2003: Message edited by: Sai Prasad ]
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads