consider the following lines below in the jsp service method , _jspService()
out.write(<<some text>>);
out.write(<<some text1>>);
out.write(<<some text2>>);
in this case all the text in the write method will go at once to the client,
if u want the some text will go first then some text1 after that some text2 then we can have the logic like below
out.write(<<some text>>);
out.flush();
out.write(<<some text1>>);
out.flush();
out.write(<<some text2>>);
out.flush();
so here some text will go the client after first flush method with out waiting for the some text1.
that is the usage of flush method.
out.write(<<some text>>);
out.write(<<some text1>>);
out.write(<<some text2>>);
in this case all the text in the write method will go at once to the client,
if u want the some text will go first then some text1 after that some text2 then we can have the logic like below
out.write(<<some text>>);
out.flush();
out.write(<<some text1>>);
out.flush();
out.write(<<some text2>>);
out.flush();
so here some text will go the client after first flush method with out waiting for the some text1.
that is the usage of flush method.
Thank you. Simple explanation that I needed :-)
ReplyDelete