Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Looong servlet operations

 
Andrew Sweeney
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings all,
I'm developing a servlet to be called from a JSP. This particular servlet will take a good amount of time, due to some processing needs. I'm trying to find a way to update the user while this processing is taking place. I don't need a percentage or amount of time, as the processing is not consistent per each request. All I need is something to inform the user that the process is continuing. I have seen similar problems on the JDC forums, but I have yet to see a satisfactory solution. Any ideas?
Thanks!
 
Aaron Dressin
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could always use Javascript and DHTML to popup a <DIV> with a background color and some text on it (or even an animated gif).
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18168
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"long-running servlet" is an oxymoron.
As I've mentioned before, the best way to think of a servlet is not as a program you can chat with, but as a subroutine call made by the client (RPC, if you will) that will time out if the results don't come back soon enough. And, in any event, depending on the design of the client and server systems, the client may not display ANYTHING AT ALL until the servlet has finished executing - which kind of makes putting up a "please wait" message futile.
If you've searched earlier discussions on this topic here in the JavaRanch Servlet forum and were not satisfied with the solutions suggested, I can only say "I'm sorry". The limitation is not in Java, it's in how HTTP works.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic