• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Progress Bar Issue in JSP

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing to do with JSP -- moved to the HTML forum.
 
Adi Kulkarni
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 129
Firefox Browser Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic