天天看点

Struts2中struts.xml配置文件,result配置详解

Struts2中struts.xml配置文件,result配置详解。

Type类型值 作用说明 对应类
chain 用来处理Action链 com.opensymphony.xwork2.ActionChainResult
dispatcher 用来转向页面,通常处理JSP org.apache.struts2.dispatcher.ServletDispatcherResult
redirect 重定向到一个URL org.apache.struts2.dispatcher.ServletRedirectResult
redirectAction 重定向到一个Action org.apache.struts2.dispatcher.ServletActionRedirectResult
plainText 显示源文件内容,如文件源码 org.apache.struts2.dispatcher.PlainTextResult
freemarker 处理FreeMarker模板 org.apache.struts2.views.freemarker.FreemarkerResult
httpheader 控制特殊http行为的结果类型 org.apache.struts2.dispatcher.HttpHeaderResult
stream 向浏览器发送InputSream对象,通常用来处理文件下载,还可用于返回AJAX数据。 org.apache.struts2.dispatcher.StreamResult
velocity 处理Velocity模板 org.apache.struts2.dispatcher.VelocityResult
xslt      处理XML/XLST模板  org.apache.struts2.views.xslt.XSLTResult

继续阅读