读书人

struts2中result的type跳转门类

发布时间: 2012-10-16 09:57:37 作者: rapoo

struts2中result的type跳转类型
原文http://www.iteye.com/topic/305413

chain

用来处理Action链

com.opensymphony.xwork2.ActionChainResult

dispatcher

用来转向页面,通常处理JSP

org.apache.struts2.dispatcher.ServletDispatcherResult

freemaker

处理FreeMarker模板

org.apache.struts2.views.freemarker.FreemarkerResult

httpheader

控制特殊HTTP行为的结果类型

org.apache.struts2.dispatcher.HttpHeaderResult

redirect

重定向到一个URL

org.apache.struts2.dispatcher.ServletRedirectResult

<result name="success" type="redirect">${url}</result>
在action中通过request.setAttribute("url","index.jsp");设置路径

redirectAction

重定向到一个Action

org.apache.struts2.dispatcher.ServletActionRedirectResult

<result name="success" type="redirectAction">
<param name="namespace">/com/action</param>
<param name="actionName">loginAction</param>
</result>

stream

向浏览器发送InputSream对象,通常用来处理文件下载,还可用于返回AJAX数据

org.apache.struts2.dispatcher.StreamResult

velocity

处理Velocity模板

org.apache.struts2.dispatcher.VelocityResult

xslt

处理XML/XLST模板

org.apache.struts2.views.xslt.XSLTResult

plainText

显示原始文件内容,例如文件源代码

org.apache.struts2.dispatcher.PlainTextResult

redirect-action

重定向到一个Action

org.apache.struts2.dispatcher.ServletActionRedirectResult

plaintext

显示原始文件内容,例如文件源代码

org.apache.struts2.dispatcher.PlainTextResult

读书人网 >软件架构设计

热点推荐