Servlet/JSP how to display an html page and then replace the page after a delay
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Diane_Benz
Posted On:   Friday, December 20, 2002 06:04 PM

This is the scenario: A User submits a request using an html form. A servlet
spawns a new thread to process the request on the server and displays an initial html
page at the client with an image that indicates that the process is running.
Once the process has completed, the servlet is supposed to display
a final html page that shows an image indicating completion of the process.
How can I replace the initial page with a new page through the servlet?
Any suggestions would be appreciated.
Thanks, D. Benz

Re: Servlet/JSP how to display an html page and then replace the page after a delay

Posted By:   Jeff_Hubbach  
Posted On:   Saturday, December 21, 2002 03:09 PM

You can't "push" the new page to the web browser, as their request has already been fulfilled (with the temporary page). You can either write some javascript that refreshes the page after x seconds to a location that contains your result page, or you can have a link on the temporary page that you tell the user to click on, which takes them to the result page. Check out how dslreports.com does it when you try to prequalify for DSL. It gives you back a temporary page with a simple animated gif, which looks like it's updating it in real-time to tell you how much longer you have to wait. Then, once it says it's done, you click on the image to get your result page.
About | Sitemap | Contact