File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Displaying the progress of a Long running Servlet request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Displaying the progress of a Long running Servlet request" Watch "Displaying the progress of a Long running Servlet request" New topic
Author

Displaying the progress of a Long running Servlet request

Joe Paolangeli
Ranch Hand

Joined: Apr 05, 2000
Posts: 73
I have a long running servlet and would like to display the progress of this process. For example the JavaRanch search engine does this by displaying how many pages have been found so far.
Has anyone implemented this type of process using servlets?
Thank you in advance,
Joe
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
I saw a suggestion the other day that the simplest way to accomplish this is to start a separate Thread doing the work and send a complete page that says "working". This page to have code to automatically request a refresh after a delay.
Every time the refresh request comes back your servlet looks to see if the working Thread is finished.
Bill

------------------
author of:
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 671
If the separate Thread has exceptions, how to report them back to the servlet that invoked this thread so that the servlet can display the exception message to the user?
Thanks.


BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying the progress of a Long running Servlet request