• 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

(servlet) downloading a dynamically generated file

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

I am pretty tired of search the net...
So I post the Q here.

I am trying to download a dynamically generated file. It is not a real file I have in the server but an "Apache POI HSSFWorkbook", which can be downloading by the client as an excel sheet (or HorribleSpreadSheetFormat .

I found a lot of aproaches for "real files". How is it with "objects" in cache (like a HSSFWorkbook).

Thanks for any help,
javo
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For dynamic files, you could simply write a rountine that writes the dynamic content to the ServletOutputStream when the rountine is invoked. The content can be generated within that rountine as well, no matter a *real* Excel file, or CSV files.

Nick
 
Javoso Torso
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Nick,

I also tryed that aproach. And it partly works!

Better explained:

I am using JSF.
The download method is in a action-methode which I call from one page. I have to present the "download-Mask" and (after the download or the cancel) return to the same page.
So far so good and working well. I can open the downloaded file and it is all ok.
BUT
My problem is when I try to use another "action method" in that page (after the download)
it comes again the "download-Mask" !!
even if that has nothing to do with this other "action method".

So: something not closed? I try many other ways with no result...

CODE:

faces-config:




downloadMethod:
(as written above I already used other ways like: the write method from HSSFWorkbook, or other dispositions, etc.)




page:




Any ideas?
Thanks!
javo
[ December 17, 2004: Message edited by: Javoso Torso ]
 
Javoso Torso
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
reply
    Bookmark Topic Watch Topic
  • New Topic