aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Progress Bar Issue in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Progress Bar Issue in JSP" Watch "Progress Bar Issue in JSP" New topic
Author

Progress Bar Issue in JSP

Adi Kulkarni
Ranch Hand

Joined: Mar 12, 2009
Posts: 86
Hello,

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 ?

Thanks,
Aditya


SCJP 1.5
D Toney
Greenhorn

Joined: Jul 21, 2010
Posts: 4
You can use AJAX for this purpose. On call back you can disable the progress bar, without reloading the page, using java script.
Adi Kulkarni
Ranch Hand

Joined: Mar 12, 2009
Posts: 86
Hello D Toney,

I was thinking of AJAX , but I've never used it. Can you give an example as to how I can use it here ?

Thanks,
Aditya
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60997
    
  65

Nothing to do with JSP -- moved to the HTML forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Adi Kulkarni
Ranch Hand

Joined: Mar 12, 2009
Posts: 86
Hello,

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 ?

Thanks,
Aditya
vijin das
Ranch Hand

Joined: Jun 07, 2010
Posts: 129

you can use dwr ajax framework for solving this

just check dwr website to learn how to use for your project dwrhome

i already found dwr sample here sample


VIJINDAS
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Adi Kulkarni wrote:Hello,

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 ?

Thanks,
Aditya


Without seeing your code, it is basically impossible to say why it fails.

Eric
Adi Kulkarni
Ranch Hand

Joined: Mar 12, 2009
Posts: 86
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.


JavaScript



Servlet Code




Kindly help,

Thanks,
Aditya
 
jQuery in Action, 2nd edition
 
subject: Progress Bar Issue in JSP