Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying the progress of a Long running Servlet request

 
Joe Paolangeli
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic