所有result-type

 <result-types>
<result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/>
<result-type name="dispatcher" class="org.apache.struts2.result.ServletDispatcherResult" default="true"/>
<result-type name="freemarker" class="org.apache.struts2.views.freemarker.FreemarkerResult"/>
<result-type name="httpheader" class="org.apache.struts2.result.HttpHeaderResult"/>
<result-type name="redirect" class="org.apache.struts2.result.ServletRedirectResult"/>
<result-type name="redirectAction" class="org.apache.struts2.result.ServletActionRedirectResult"/>
<result-type name="stream" class="org.apache.struts2.result.StreamResult"/>
<result-type name="velocity" class="org.apache.struts2.result.VelocityResult"/>
<result-type name="xslt" class="org.apache.struts2.views.xslt.XSLTResult"/>
<result-type name="plainText" class="org.apache.struts2.result.PlainTextResult" />
<result-type name="postback" class="org.apache.struts2.result.PostbackResult" />
</result-types>

structs.xml

<action name="testResult" class="com.TestResultAction">

 
<!--默认转发 -->
<result name="success" type="dispatcher">/success.jsp</result>
<!-- 重定向-->
<result name="login" type="redirect">/login.jsp</result> <!-- 重定向到一个 Action -->
<!-- <result name="index" type="redirectAction">
<param name="actionName">testAction</param>
<param name="namespace">/test</param>
</result> --> <!-- 通过 redirect 的响应类型也可以便捷的实现 redirectAction 的功能! -->
<result name="index" type="redirect">/test/testAction</result> <!-- 转发到一个 Action -->
<!-- <result name="test" type="chain">
<param name="actionName">testAction</param>
<param name="namespace">/test</param>
</result> --> <!-- 不能通过 type=dispatcher 的方式转发到一个 Action -->
<result name="test">/test/testAction</result> <package name="testPackage" namespace="/test" extends="struts-default">
<action name="testAction" class="com.TestAction">
<result>/success.jsp</result>
</action>
</package>

Struts2-result的更多相关文章

  1. struts2 Result Type四个常用转跳类型

    Result的四个常用转跳类型分别为 Dispatcher 用来转向页面,是Struts的默认形式 Redirect   重定向到一个URL Chain  用来处理Action链 RedirectAc ...

  2. Struts2(result 流 )下载

    jsp: <body> <a href="stream.action?fileName=psb.jpg">psb</a> <br> ...

  3. struts2 result type类型

    result标签中type的类型 类型 说明 chain 用于Action链式处理 dispatcher 用于整合JSP,是<result>元素默认的类型 freemarket 用来整合F ...

  4. Struts2 result type(结果类型)

    转自:http://www.cnblogs.com/liaojie970/p/7151103.html 在struts2框架中,当action处理完之后,就应该向用户返回结果信息,该任务被分为两部分: ...

  5. Struts2 result type

    Struts2支持的不同类型的返回结果为: type name 说明 dispatcher 缺省类型,用来转向页面,通常处理JSP chain 转向另一个action,用来处理Action链 redi ...

  6. struts2 result的type属性

    目前只使用过以下3种,都是直接跳转到另一个action  chain: 写法:<result name="success" type="chain"> ...

  7. struts2 result type的类型

    一共十种类型 1.dispatcher 默认的类型,相当于servlet的foward,服务器端跳转.客户端看到的是struts2中配置的地址,而不是真正页面的地址.一般用于跳转到jsp页面 2.re ...

  8. struts2 result type属性说明

    首先看一下在struts-default.xml中对于result-type的定义: <result-types><result-type name="chain" ...

  9. 分享知识-快乐自己:Struts2 - result标签的name属性和type属性

    1):result的name属性   例如:<result name="success">/pages/success.jsp</result> Strut ...

  10. struts2 result随笔

     一.result:chain(从一个Action转发到另一个Action) chain结果类型有4个属性,分别是: actionName (default) - the name of the ac ...

随机推荐

  1. bootstrap之双日历时间段选择控件—daterangepicker(汉化版)

    jQuerybootstrapdaterangepicker汉化版 双日历时间段选择插件 — daterangepicker是bootstrap框架后期的一个时间控件,可以设定多个时间段选项,也可以自 ...

  2. C#中委托

    委托是一种安全地封装方法的类型,它与 C 和 C++ 中的函数指针类似.与 C 中的函数指针不同,委托是面向对象的.类型安全的和保险的.一个委托类型是代表与特定参数列表和返回类型的方法的引用类型.实例 ...

  3. #define INVSQRT2 0.707106781 平方根倒数速算法

    转自 http://www.cnblogs.com/pkuoliver/archive/2010/10/06/1844725.html 源码下载地址:http://diducoder.com/sotr ...

  4. asp.net core webapi iis jquery No 'Access-Control-Allow-Origin' header is present on访问跨域问题

    我的解决方案是:设置特定method允许所有请求源访问,具体看业务需求 第一步:starup文件下ConfigureServices中增加如下配置 //跨域//设置了允许所有来源 services.A ...

  5. JavaScript获取DOM对象的几种方式

    1.getElementById() 方法可返回对拥有指定 ID 的第一个对象的引用 2.getElementsByName() 方法可返回带有指定名称的对象的集合 3.getElementsByTa ...

  6. mysql-5.7.19免安装版的配置方法

    1. 下载MySQL Community Server 5.6.13 2. 解压MySQL压缩包     将以下载的MySQL压缩包解压到自定义目录下,我的解压目录是:     "D:\Pr ...

  7. NOIP需要掌握的内容(大致

    1.排序算法(快排.选择.冒泡.堆排序.二叉排序树.桶排序)2.DFS/BFS 剪枝 哈希表3.树   ①遍历   ②二叉树   ③二叉排序树(查找.生成.删除)   ④堆(二叉堆.左偏树.堆排序)  ...

  8. Pairs of Songs With Total Durations Divisible by 60 LT1010

    In a list of songs, the i-th song has a duration of time[i] seconds. Return the number of pairs of s ...

  9. 好像leeceode题目我的博客太长了,需要重新建立一个. leecode刷题第二个

    376. Wiggle Subsequence               自己没想出来,看了别人的分析. 主要是要分析出升序降序只跟临近的2个决定.虽然直觉上不是这样. 455. 分发饼干     ...

  10. SQL判断如果一列值为null则取另一列值代替 isnull()

    [chClientCode] ,[nvcClientName] ,[chRegionCode] ,isnull(chUltimateHeadClientCode,[chClientCode]) as ...