Apache Struts 2 Documentation > Home > Guides > Core Developers Guide > Result Types > Stream Result |
A custom Result type for sending raw data (via an InputStream) directly to the HttpServletResponse. Very useful for allowing users to download content.
![]() | If you are running your app server under HTTPS and having issues with PDF's or other file streams you should take a look at HTTPS and IE Issues |
text/plain
).inline
, values are typically
attachment;filename="document.pdf".inputStream
).1024
).true
)
These parameters can also be set by exposing a similarly named getter method on your Action. For example, you can
provide getContentType()
to override that parameter for the current action.
<result name="success" type="stream"> <param name="contentType">image/jpeg</param> <param name="inputName">imageStream</param> <param name="contentDisposition">attachment;filename="document.pdf"</param> <param name="bufferSize">1024</param> </result>