If i have the below code:
<%
out.write("This will print!<br/>");
out.flush();
out.write("This will also print!<br/>");
out.flush(); <-- Should fail.
out.write("This will get sent to the client too!<br/>");
%>
Why is the second flush being allowed?
I thought that a flush will commit a response and being sent to the client. Once a response is commited, you can't write and flush anymore. The first flush commited the response and has sent to the client. So i would expect the second flush to fail.
I also read that for an include on the requestDispatcher, one can flush as many times as you want (but not for a requestDispatcher forward). How is that so?
I'm confused on this and i would appreciate any enlightening. Thanks.