• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

download file in struts2

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does anyone here have experieces with stream result type?
please help

struts.xml


index.jsp


TestOpenCsv.java


if i use "link download", everything is ok except a new window always pops up.
if i use "button download", a download confirm dialog pops up and asks me what i want to do----open, save, or cancel, so far so good.
but if i choose open, another confirm dialog will pop up, and i need to click open again to open the file. (BTW: save and cancel work just fine.)
i have been working on this for 4 hours and have no clue.
please help.
thanks in advance.

and another question about stream result type.
what if the content for download is not from a file by constructed dynamically, do i need to create a file for it?
 
zheng li
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
struts.xml is wrong,
below is the right one


is there anyone who has the same problem?
 
zheng li
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seems i should use get but not post to download a file
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic