File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Looong servlet operations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Looong servlet operations" Watch "Looong servlet operations" New topic

Looong servlet operations

Andrew Sweeney

Joined: Jan 11, 2002
Posts: 26
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?
Aaron Dressin

Joined: May 10, 2002
Posts: 29
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

Joined: Jun 25, 2001
Posts: 17280

"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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Looong servlet operations
It's not a secret anymore!