struts2.xml 中result type属性说明
2017-01-20 14:14
435 查看
一.struts2.xml 中result type属性说明
1.chain:用来处理Action链,被跳转的action中仍能获取上个页面的值,如request信息。
com.opensymphony.xwork2.ActionChainResult
2.dispatcher:用来转向页面,通常处理JSP
org.apache.struts2.dispatcher.ServletDispatcherResult
3.freemaker:处理FreeMarker模板
org.apache.struts2.views.freemarker.FreemarkerResult
4.httpheader:控制特殊HTTP行为的结果类型
org.apache.struts2.dispatcher.HttpHeaderResult
5.stream:向浏览器发送InputSream对象,用来处理文件下载,还可用于返回AJAX数据
org.apache.struts2.dispatcher.StreamResult
6.velocity :处理Velocity模板
org.apache.struts2.dispatcher.VelocityResult
7.xsl: 处理XML/XLST模板
org.apache.struts2.views.xslt.XSLTResult
8.plainText:显示原始文件内容,例如文件源代码
org.apache.struts2.dispatcher.PlainTextResult
9.plaintext:显示原始文件内容,例如文件源代码
org.apache.struts2.dispatcher.PlainTextResult
10.redirect:重定向到一个URL ,被跳转的页面中丢失传递的信息,如request
org.apache.struts2.dispatcher.ServletRedirectResult
11.redirectAction :重定向到一个Action ,跳转的页面中丢失传递的信息,如request
org.apache.struts2.dispatcher.ServletActionRedirectResult
12.redirect-action:重定向到一个Action ,跳转的页面中丢失传递的信息,如request
org.apache.struts2.dispatcher.ServletActionRedirectResult
二.redirect与redirect-action区别
1. 使用redirect需要后缀名 使用redirect-action不需要后缀名
2. type="redirect" 的值可以转到其它命名空间下的action,而redirect-action只能转到同一命名空下的 action,因此它可以省略.action的后缀直接写action的名称。如:
<result name="success" type="redirect">viewTask.action</result>
<result name="success" type="redirect-action">viewTask</result>
1.chain:用来处理Action链,被跳转的action中仍能获取上个页面的值,如request信息。
com.opensymphony.xwork2.ActionChainResult
2.dispatcher:用来转向页面,通常处理JSP
org.apache.struts2.dispatcher.ServletDispatcherResult
3.freemaker:处理FreeMarker模板
org.apache.struts2.views.freemarker.FreemarkerResult
4.httpheader:控制特殊HTTP行为的结果类型
org.apache.struts2.dispatcher.HttpHeaderResult
5.stream:向浏览器发送InputSream对象,用来处理文件下载,还可用于返回AJAX数据
org.apache.struts2.dispatcher.StreamResult
6.velocity :处理Velocity模板
org.apache.struts2.dispatcher.VelocityResult
7.xsl: 处理XML/XLST模板
org.apache.struts2.views.xslt.XSLTResult
8.plainText:显示原始文件内容,例如文件源代码
org.apache.struts2.dispatcher.PlainTextResult
9.plaintext:显示原始文件内容,例如文件源代码
org.apache.struts2.dispatcher.PlainTextResult
10.redirect:重定向到一个URL ,被跳转的页面中丢失传递的信息,如request
org.apache.struts2.dispatcher.ServletRedirectResult
11.redirectAction :重定向到一个Action ,跳转的页面中丢失传递的信息,如request
org.apache.struts2.dispatcher.ServletActionRedirectResult
12.redirect-action:重定向到一个Action ,跳转的页面中丢失传递的信息,如request
org.apache.struts2.dispatcher.ServletActionRedirectResult
二.redirect与redirect-action区别
1. 使用redirect需要后缀名 使用redirect-action不需要后缀名
2. type="redirect" 的值可以转到其它命名空间下的action,而redirect-action只能转到同一命名空下的 action,因此它可以省略.action的后缀直接写action的名称。如:
<result name="success" type="redirect">viewTask.action</result>
<result name="success" type="redirect-action">viewTask</result>
相关文章推荐
- struts2.xml 中result type属性说明
- struts2.xml 中result type属性说明
- Struts2.xml中result type属性说明
- struts2.xml 中result type属性说明
- struts2.xml 中result type属性说明
- 道听途说Struts2之14:struts2.xml 中result type属性说明
- struts2.xml中的result type属性说明
- Struts2.xml中result_type属性说明
- struts2.xml 中result type属性说明
- struts2.xml 中result type属性说明
- struts2.xml 中result type属性说明
- struts2.xml中的result type属性说明
- struts2.xml 中result type属性说明
- struts2.xml 中result type属性说明
- struts2.xml 中的result标签type属性
- truts2.xml 中result type属性说明
- struts2 struts.xml result type 属性的说明
- struts2.xml中使用chain和redirectAction这两个类型结果(type-result)时,报检查错误(validation)
- struts2 result type属性说明
- struts.xml文件中 result标签的 type 属性为redirectAction时URL参数与值的获得