PDA

View Full Version : Need urgent help in Loading icon java script



Javafreak
06-11-2010, 04:56 AM
I have a jsp page in which there is a "Download" button which calls an action class and generates an word document.
Now while the action class is being processed and word doc come up, I need to put an image loading icon (I already have loading image and using in several places like while coming from one page to other).

The problem with opening word doc is there will not be a response back to the page and so I couldnt use java script to start and stop displaying the image.

Can any one help please??

djr33
06-11-2010, 05:19 AM
It's really hard to answer: how would you know when it's completed? This is a question about JSP and how it would let you know, then you can use Javascript.
You could use a Java applet if you're comfortable with that, but that comes with problems such as a security warning when it loads in a browser.

One option is that you could use Ajax or some other way of finding out when the page is done then forward the user after it is... or something like that. But I'm not sure of all the details.

This is in general a complication of how serverside processing works. You might be able to borrow some ideas from upload scripts (with a desired progress bar), but there isn't a good answer there either.