The flush attribute controls flushing. If true, then, if the page output is buffered and the flush attribute is given a true value, then the buffer is flushed prior to the inclusion, otherwise the buffer is not flushed. The default value for the flush attribute is false.
forward doesn't let you write something before forwarding. So it's of no use in a forward action More on the use of flush in include action please read this discussion
consider this sample coding given by Marc Peabody .
<% out.write("This will print!<br/>"); out.flush(); out.write("This will also print!<br/>"); out.flush(); out.write("This will get sent to the client too!<br/>"); %>
by default jsp pages are buffered.that means the stuff written to the JspWriter (out) object does not immediately or directly goes to the client through the response.
the character are stored in the buffer and once we flush it everything in the buffer goes to the client through the response object.
but in the above coding. the flush is been used many times. my doubt is on each time we are invoking the flush method on out object means each time it gets the datas stored in the buffer is sent to the client through the response object?? for example : flush is used 2 times in the above code. then response object will be invoked twice??