Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

File Download functionality in Struts 1.x

Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have a requirement where if the user clicks on the Download icon with respect to an XML file, the user should be prompted with a dialog for either "Open" or "Save" or "Cancel" the operation. Right now, all these are working fine. But the new requirement is that, on click of the "Open" command xml file should be direclty opened , or if "Save" button is clicked then the file should be saved as "tar.gz" file with custom defined folder structure defined in the server code.

My question is how do we invoke the server code when the file is already flushed to the output stream, and how do we make sure on click of te save button it will call the server code.

Here is a snap shot of download function
[Thumbnail for Download.png]
Posts: 9626
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That dialog is created by the browser, so we don't have control over it. You could provide two links on your page to open/save. Perhaps you could create a dialog with JavaScript to mimic the download dialog.
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic