已迁移到新家:小窝【http://www.myzuji.cn/article/14.html】
1、chain:用来处理Action链,被跳转的Action中仍能获取上个页面的值,如request信息。
所在类——com.opensymphony.xwork2.ActionChainResult
2、dispatcher:用来转向页面,通常处理JSP。
所在类——org.apache.struts2.dispatcher.ServletDispathcerResult
3、freemaker:处理FreeMarker模板。
所在类——org.apache.struts2.views.freemarker.FreemarkerResult
4、httpheader:控制特殊HTTP行为的结果类型。
所在类——org.apache.struts2.dispatcher.HttpHeaderResult
5、stream:向浏览器发送InputStream对象,用来处理文件下载,还可用于返回AJAX数据
所在类——org.apache.struts2.dispatcher.VelocityResult
6、velocity:处理Velocity模板
所在类——org.apache.struts2.dispatcher.VelocityResult
7、xsl:处理XML/XLST模板
所在类——org.apache.struts2.views.xslt.XSLTResult
8、plianText:显示原始文件内容例如文件源代码
所在类——org.apache.struts2.dispatcher.PlainTextResult
10、redirect:重定向到一个URL,被跳转的页面中丢失传递的信息,如request
所在类——org.apache.struts2.dispatcher.ServletActionRedirectResult
11、redirect-action:重定向到一个Action,跳转的页面中丢失传递的信息,如request
所在类——org.apache.struts2.dispatcher.ServletActionRedirectResult
本文详细介绍了Struts2框架中的各种结果类型及其应用场景,包括chain、dispatcher、freemaker等,帮助开发者更好地理解和使用这些结果类型来实现不同的功能。
1418

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



