On Wed, April 5, 2006 9:07 am, Dave Newton said:
> red phoenix wrote:
>> I want to realize download function in struts,and I will put some file
>> url
>> in JSP file,when click one of the file url,this file will be
>> download.Dostruts or some taglib support download function?
>>
>
> You mean... like a link?

Hehe :)

My guess is red wants to ensure the browser reacts with a download prompt
rather than trying to open known content.  In that case, setting the
Content-Disposition header is what will do the trick.

Note that if you are using a relatively recent version of Struts (from
1.2.6 on if memory serves), there is a DownloadAction specifically for
this sort of thing.  Here is a Wiki page detailing it:

http://wiki.apache.org/struts/StrutsFileDownload

> Dave

Frank

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to