Session A Mwamufiya wrote:
I'm following the filedownload example from the showcase, but would
like to be able to set the content disposition filename in my code,
rather than have it hardcoded in the struts.xml file.
Just like any other result parameter, it can be set using OGNL
(unfortunately delineated by "${}" instead of "%{}").
So try:
<param name="contentDisposition">${contentDisposition}</param>
and add a "public String getContentDisposition()" method to SMIGExport.
I really suggest adding a "contentLength" parameter, otherwise the
framework may well have you generate the full content twice: Once to
determine the length, and again to send it.
<param name="contentDisposition">savedName</param>
And keep in mind, the value for "contentDisposition" should not be a
fileName, but rather a disposition (I.E. "inline" or "attachment"),
which can subsequently take a filename argument.
Here's an example putting that all together:
<param
name="contentDisposition">inline;filename="${media.code}.Media.${size}.${media.suffix}"</param>
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]