Struts2 关于返回type="chain"的用法.

来源:互联网 发布:通达信炒股软件官网 编辑:程序博客网 时间:2024/05/16 07:20
 

Struts2 关于返回type="chain"的用法.

分类: Struts2开发 4080人阅读 评论(0) 收藏 举报
strutsfreemarkervelocityredirectactionxslt
 
见到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 0
原创粉丝点击