struts.xml配置
<action name="xxx" class="xxxxx"> <result type="stream"></result> </action>
action代码
private InputStream inputStream; public String execute() { inputStream = new ByteArrayInputStream("hello".getBytes("iso-8859-1")); return SUCCESS; }
说明: 现在没有在result中使用param,即使用默认的参数contentType:text/html, inputName: inputStream
原文:http://www.cnblogs.com/zhufengxiang/p/4899386.html