-
what is the use of flush in jsp? (3 messages)
- Posted by: Naveen kumar k.v
- Posted on: April 10 2008 23:12 EDT
hi , can anyone tell the purpose or use of flush in jsp??Threaded Messages (3)
- Re: what is the use of flush in jsp? by Jyothish John on April 11 2008 07:23 EDT
- doubt in flush by Naveen kumar k.v on April 25 2008 00:18 EDT
- Re: doubt in flush by Jyothish John on June 09 2008 12:30 EDT
- doubt in flush by Naveen kumar k.v on April 25 2008 00:18 EDT
-
Re: what is the use of flush in jsp?[ Go to top ]
- Posted by: Jyothish John
- Posted on: April 11 2008 07:23 EDT
- in response to Naveen kumar k.v
flush will pump the available output in the responsebuffer right away to the browser, ie you can write cunks of content in steps. For eg; We can render an html Div with an animated image (like a hour glass) showing the status of the page downloading in process, while the page is still being buffered and once the content is fully buffered, you may append some javascript to hide the hour glass and render the content to the screen once the processing is finished. -
doubt in flush[ Go to top ]
- Posted by: Naveen kumar k.v
- Posted on: April 25 2008 00:18 EDT
- in response to Jyothish John
hi I have read HFSJ book where the purpose of flush is stated as Once the flush method is invoked ,the response object is commited. commited means the response is sent to the client. but below in this samplecoding "); out.flush(); out.write("This will also print!
"); out.flush(); out.write("This will get sent to the client too!
"); %> my doubt is 1., If a flush method is used ,is the response is commited or not? 2., If the response is commited means ,then how can we use flush or print message once again ?? please clarify me. -
Re: doubt in flush[ Go to top ]
- Posted by: Jyothish John
- Posted on: June 09 2008 12:30 EDT
- in response to Naveen kumar k.v
hi
out.write("This will print!
I have read HFSJ book where the purpose of flush is stated as
Once the flush method is invoked ,the response object is commited.
commited means the response is sent to the client.
but below in this samplecoding
out.write("This will print!
");
out.flush();
out.write("This will also print!
");
out.flush();
out.write("This will get sent to the client too!
");
%>
my doubt is
1., If a flush method is used ,is the response is commited or not?
2., If the response is commited means ,then how can we use flush or print message once again ??
please clarify me.
");
out.flush(); // here the contents in the outputstream is already sent to the browser, while you can still write other stuff like below to the outputstream, and flush the contents on will.
out.write("This will also print!
");
out.flush();
out.write("This will get sent to the client too!
");
%>