This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a JSP page which has a link for downloading. I have to show a progress bar when the user clicks on the link till the download box appears.
I have enclosed this link in a FORM tag, and the action for this tag is a Servlet which does the downloading part. Now since the action is not the same JSP, the progress bar isnt getting closed even after the download box appears. I cannot redirect to JSP page from the action servlet since the page takes a long time to reload.
How can I stop the progress bar without reloading the page again ?
Also, it is possible to reload the page parallely before the download box appears ?
I tried using AJAX for the same. Somehow I am unable to get the response from the servlet.
Since the server side code already sets the contenttype as text/csv ( Since it is the code to write to CSV file), I am not getting the reponse from the server.
How can I get a response in this case ?
Without seeing your code, it is basically impossible to say why it fails.
Joined: Mar 12, 2009
Hello Eric ,
I need to do the following.
1: Click a link on the Jsp page to download to a CSV file.
2: After clicking this link, a progress animator should start till the download box appears.
3: The progress animator should get disabled once the box comes.
Now since the CSV downloading code is in a Servlet , we tried using AJAX for the same. But now the download box isnt coming. Following is the code sample we've tried.