GeeCON Prague 2014*
The moose likes Spring and the fly likes Is there an event for a file download? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Is there an event for a file download?" Watch "Is there an event for a file download?" New topic
Author

Is there an event for a file download?

Nickolas Case
Ranch Hand

Joined: Apr 26, 2008
Posts: 98
I have an application that will return data in three different ways, two of which being a file download. The third being an HTML page. When a user clicks the HTML button, a throbber pops up while the page is built(DB queries and report generation take 15 to 20 seconds) and goes away once the HTML is ready. When the user clicks one of the other two options for a download, nothing happens. This is the issue. Is there a way to pop up the throbber for the download portions and listen for the open/save/cancel dialog box? That way the throbber doesn't just stay there after the download.

I am using Spring MVC. Any suggestions?
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
How do you implement this throbber pops up?


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Nickolas Case
Ranch Hand

Joined: Apr 26, 2008
Posts: 98
The throbber pops up using jquery. I can get the throbber to show for any of the views, it's getting the throbber to disappear once the file starts to download that I am having difficulty with. For the HTML piece, the jsp uses a javascript redirect to relaod the page the throbber is on. I could set a timeout, but I can't guarantee the file will be ready for download by then.
 
GeeCON Prague 2014
 
subject: Is there an event for a file download?