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

 
见到struts.xml 当中有这么个配置

 showArticle


这个type="chain"是什么意思呢?
 

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

你可能感兴趣的:(Struts2开发)