struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Newfield <D...@Newfield.org>
Subject Re: [struts] servletOutputStream in S2 action
Date Thu, 07 Feb 2008 22:05:06 GMT
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


Mime
View raw message