You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dale Newfield <Da...@Newfield.org> on 2008/02/07 23:05:06 UTC
Re: [struts] servletOutputStream in S2 action
Mike Jennings wrote:
> You can do this by creating a custom result type.
Or you can use a result type that's already provided that does exactly
what you need.
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/StreamResult.html
>> How can i do the same in my execute method for S2?? what should the
>> execute method return? because when user clicks get Excel link..the
>> page stays the same but just the user is presented with open/save
>> dialog.
What the browser does with the data (attempt to display it/save it) is
determined by the "contentDisposition" You want that to read something
like: "attachment;filename=${something.dynamic}.xls"
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org