Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

timer page in jsp

Status
Not open for further replies.

Cairlinn

MIS
Jan 31, 2001
4
US
I would like to have my jsp page call another jsp page to process some data. While this second page is processing the data, how can I send a 'Please wait while processing...' type page (html or jsp) to the browser?
Any help or tips would be greatly appreciated
 
Several ways to do that. Here is a simple one.

set buffering off.

Start your response HTML and body and use tables or something to create the progress bar. I have used DIV elements with 'width' attributes in IE.

begin your background process.

begin a loop with a wait() or sleep() depending on how you implement your background process thread.

when your wait/sleep ends get your progress from the backgound process then write a HTML SCRIPT element containing line(s) of code that update the width of the progress bar element that you already sent.

Continue until background progress completes.

Send the remainder of the page, i.e. a completed message, then send another script element that hides the progress bar and shows the message element.

Hope this helps
-pete
 
Is it the buffering that allows the timer page to be displayed from the background processing page.

In the background processing page, do I use
<@page include=&quot;timer.jsp&quot; buffer=&quot;none&quot;%>
then continue the background process code.

 
Yes, or not buffering as it were. If buffering is on then the stream is not sent to the browser until you finish and the stream is closed.

-pete
 
Can you please send me a sample code for displaying a wait message between 2 jsp pages.
email: vikvikvik_r@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top