How to define the stream Result annotation?

ぐ巨炮叔叔 提交于 2019-11-28 12:44:35

Return result as a binary stream

private InputStream inputStream;
private String filename; 

//getters here
public InputStream getInputStream() {
    return inputStream;
}

public String getFilename() {
  return filename;
}

@Result(name="success", type=StreamResult.class, value="inputStream", params={"contentType","application/octet-stream", "contentDisposition", "attachment;filename=\"${filename}\"", "inputName", "inputStream"})

String filename = filters.getPeriod() + "_" +filters.getRegion() ;
File file = new File(filename);
inputStream = new FileInputStream(file);
return SUCCESS;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!