Seems like a reasonable request to me.

The best way to get these types of enhancements incorporated is to open up a
JIRA ticket and attach a patch file.

On Mon, Jul 7, 2008 at 3:18 PM, Struts Two <[EMAIL PROTECTED]> wrote:

> I am using struts 2.0.11.1 and I just realized that you can not
> dynamically set the filename using stream result (at least that is my
> impression after a few hours of tweaking around the code).
> I ended up extending StreamResult to set contentDisposition dynamically. I
> think it would be worthwhile if the code is modified to accomediate this
> functionality[it would be only a few lines of code added]. Here is my
> extension
> public class DynamicStreamResult extends StreamResult {
>  @Override
>  protected void doExecute(String finalLocation, ActionInvocation
> invocation)
>    throws Exception {
>   String filename = (String) invocation.getStack().findValue(
>     conditionalParse("name", invocation));
>   contentDisposition = "filename=\"" + filename + "\"";
>   super.doExecute(finalLocation, invocation);
>  }
> }
>
>
>      __________________________________________________________________
> Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your
> favourite sites. Download it now at
> http://ca.toolbar.yahoo.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to