开发者

Invoke a Struts2 action and consume result as Stream

Is this possible, within the Struts2 framework, and/or am I limited to using the URL/URLConnection classes to get the response as a stream? I've looked into the ActionComponent class but I'm not sure how to 开发者_Go百科use it?

Thanks.


I believe what you want is to use a StreamResult in your action. Check out the following:

http://struts.apache.org/2.1.2/struts2-core/apidocs/org/apache/struts2/dispatcher/StreamResult.html

Here's an example for downloading a file:

http://www.mkyong.com/struts2/struts-2-download-file-example/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜