Struts2 type="chain"的用法详细解释

见到struts.xml 当中有这么个配置
<action name="addCritique" class="addCritique">
 <result name="success" type="chain">showArticle</result>
</action>

这个type="chain"是什么意思呢?
 
<span style="font-size: 18px;"><strong>功能与redirect的action转发类似,不过与redirectaction转发功能不同的是它可以将Action中的数据一直保存在同一个HTTP请求中。</strong></span>
<strong><span style="font-size: 18px;">Struts2支持的不同类型的返回结果为:</span></strong>
<strong><span style="font-size: 18px;">Chain Result-->type="chain"用来处理Action链</span></strong>
<strong><span style="font-size: 18px;">Dispatcher Result -->type="dispatcher"用来转向页面,通常处理JSPFreeMarker</span></strong>
<strong><span style="font-size: 18px;">Result -->type="freemarker"处理FreeMarker模板HttpHeader </span></strong>
<strong><span style="font-size: 18px;">Result -->type="httpheader"用来控制特殊的Http行为Redirect </span></strong>
<strong><span style="font-size: 18px;">Result -->type="redirect"重定向到一个URLRedirect Action </span></strong>
<strong><span style="font-size: 18px;">Result -->type="redirectAction"重定向到一个ActionStream </span></strong>
<strong><span style="font-size: 18px;">Result -->type="stream"向浏览器发送InputSream对象,通常用来处理文件下载Velocity </span></strong>
<strong><span style="font-size: 18px;">Result -->type="velocity"处理Velocity模板XLST Result -->type="xslt"处理XML/XLST模板PlainText </span></strong>
<strong><span style="font-size: 18px;">Result -->type="plainText"显示原始文件内容,例如文件源代码另外第三方的result类型还包括JasperReports Plugin,专门用来处理JasperReport类型的报表输出。</span></strong>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值