Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 17th, 2007, 11:51 PM
Registered User
 
Join Date: Oct 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to nishi_gupta
Default Struts+downloadAction

i have given a link on .jsp page then written download action class and then struts-config.xml but the problem is ,on running the application,its running fine .
but it is taking the name as path name and then downloading the file .eventhough the file is getting downloaded ,but the proper format is lost.
I think in struts-config action tag ,some other tag is required which will allow the proper format to be downloaded.
can anyone help me out ASAP.

regards
Nishi

 
Old October 24th, 2007, 01:13 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Try setting the following header
Code:
response.setHeader("Content-disposition","attachment; filename=\""+filename+"\"");
"filename" is the complete file name with extension.

This name will be displayed in the download box displayed by the browser.



- Rakesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
struts actions package: "struts", other packages? ojasrege Struts 1 July 21st, 2007 06:02 AM
Struts [email protected] Struts 2 November 13th, 2006 07:10 AM
about struts kishore.dyn Struts 4 August 8th, 2006 01:28 AM
struts tanaya BOOK: Professional Jakarta Struts 1 July 20th, 2006 10:51 AM
How to get upgraded from Struts 1.1 to struts 1.2. [email protected] Struts 0 January 3rd, 2006 04:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.