<action name="attachment_*" class="attachmentAction"method="{1}">
<result name="download" type="stream">//就是这个type 是什么意思 ,这是一个下载的action
<param name="contentType">${contentType}</param>
<param name="inputName">${inputName}</param>
<param name="contentDisposition">
${contentDisposition}
</param>
<param name="bufferSize">4096</param>
</result>
---------------------------------------------------------------
type="chain" 不建议
type="dispatcher" 一般的资源
type="freemarker" Freemarker模板
type="velocity" Velocity模板
type="xslt" XSLT模板
type="httpheader" 添加状态到Http头
type="redirect" 重定向
type="redirect-action" 重定向到Action
type="plaintext" 把原始内容输出(如jsp和html的原始内容)
type="stream" 把一般内容输出到流
转自:http://blog.youkuaiyun.com/a3431969/article/details/5373888
<result name="download" type="stream">//就是这个type 是什么意思 ,这是一个下载的action
<param name="contentType">${contentType}</param>
<param name="inputName">${inputName}</param>
<param name="contentDisposition">
${contentDisposition}
</param>
<param name="bufferSize">4096</param>
</result>
---------------------------------------------------------------
type="chain" 不建议
type="dispatcher" 一般的资源
type="freemarker" Freemarker模板
type="velocity" Velocity模板
type="xslt" XSLT模板
type="httpheader" 添加状态到Http头
type="redirect" 重定向
type="redirect-action" 重定向到Action
type="plaintext" 把原始内容输出(如jsp和html的原始内容)
type="stream" 把一般内容输出到流
转自:http://blog.youkuaiyun.com/a3431969/article/details/5373888
本文详细解析了Struts2框架中实现文件下载功能的方法,重点介绍了如何通过配置不同的type属性来达到预期的行为,包括使用stream类型进行文件流的处理。
210

被折叠的 条评论
为什么被折叠?



