Data is sent to the response stream on buffer flushes for buffered pages, or on encountering the first content (beware of whitespace) on unbuffered pages.
In the following code:
I am setting the buffer size to 0, which should be equivalent to an unbuffered page. Next i try to print "This is the right code " to the browser, which acc. to the spec statement above, should be flushed immediately on encountering the first println() for unbuffered pages. After that, i attempt to forward to result.jsp.
There is no IllegalStateException thrown, not even in console, even though i am trying to forward after committing the response. Secondly, instead of "This is the right code " getting printed to the browser (since the page is unbuffered), the browser gets forwarded to result.jsp, which is unexpected. With an out.flush(), "This is the right code " gets printed, but a flush() shouldn't be necc for unbuffered pages.
Please clarify when a response gets committed and why the code above exhibits such behavior.
[ March 13, 2007: Message edited by: Aniket Patil ] [ March 13, 2007: Message edited by: Aniket Patil ]
SCJP 5.0 | SCWCD 1.4 <br /> <br />If you don't know where you are going, any road will take you there!