Struts2-result
所有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的更多相关文章
- struts2 Result Type四个常用转跳类型
Result的四个常用转跳类型分别为 Dispatcher 用来转向页面,是Struts的默认形式 Redirect 重定向到一个URL Chain 用来处理Action链 RedirectAc ...
- Struts2(result 流 )下载
jsp: <body> <a href="stream.action?fileName=psb.jpg">psb</a> <br> ...
- struts2 result type类型
result标签中type的类型 类型 说明 chain 用于Action链式处理 dispatcher 用于整合JSP,是<result>元素默认的类型 freemarket 用来整合F ...
- Struts2 result type(结果类型)
转自:http://www.cnblogs.com/liaojie970/p/7151103.html 在struts2框架中,当action处理完之后,就应该向用户返回结果信息,该任务被分为两部分: ...
- Struts2 result type
Struts2支持的不同类型的返回结果为: type name 说明 dispatcher 缺省类型,用来转向页面,通常处理JSP chain 转向另一个action,用来处理Action链 redi ...
- struts2 result的type属性
目前只使用过以下3种,都是直接跳转到另一个action chain: 写法:<result name="success" type="chain"> ...
- struts2 result type的类型
一共十种类型 1.dispatcher 默认的类型,相当于servlet的foward,服务器端跳转.客户端看到的是struts2中配置的地址,而不是真正页面的地址.一般用于跳转到jsp页面 2.re ...
- struts2 result type属性说明
首先看一下在struts-default.xml中对于result-type的定义: <result-types><result-type name="chain" ...
- 分享知识-快乐自己:Struts2 - result标签的name属性和type属性
1):result的name属性 例如:<result name="success">/pages/success.jsp</result> Strut ...
- struts2 result随笔
一.result:chain(从一个Action转发到另一个Action) chain结果类型有4个属性,分别是: actionName (default) - the name of the ac ...
随机推荐
- spring源码分析(一)
一.首先分析AliasRegistry接口. 1.Alias别名,Registry注册表,AliasRegistry别名注册表接口. 2.共有四个方法,注册别名,判断是否别名,获取别名数组,移除别名. ...
- spring boot 访问项目时加项目名称
pringboot 项目一般直接地址加端口就可以访问了,不像放在tomcat里面还需要加上项目名. 现在,想访问的时候加上项目名用来区分,只要在配置文件里面加上 server.context-path ...
- Json中不支持任何形式的注释,那我们要怎么解决呢
Json中不支持任何形式的注释,我们可以使用曲线救国的思路:在对象的定义中添加一个key(comment),其对应的value值就是注释填写的语句. 如: { "name":&qu ...
- idea spring-boot gradle mybatis 搭建开发环境
使用工具idea 2017.2开发,gradle构建项目,使用的技术有spring-boot.mybatis 1.新建项目 说明:1.src为源码路径,开发主要在src下 2.src/main/jav ...
- PAT 1036 跟奥巴马一起编程(15)(代码)
1036 跟奥巴马一起编程(15)(15 分) 美国总统奥巴马不仅呼吁所有人都学习编程,甚至以身作则编写代码,成为美国历史上首位编写计算机代码的总统.2014年底,为庆祝"计算机科学教育周& ...
- PAT 1039 到底买不买(20)(20 分)
1039 到底买不买(20)(20 分) 小红想买些珠子做一串自己喜欢的珠串.卖珠子的摊主有很多串五颜六色的珠串,但是不肯把任何一串拆散了卖.于是小红要你帮忙判断一下,某串珠子里是否包含了全部自己想要 ...
- 部分开源gis 方案的比较
3.1MapServer和GeoServer的总体对比 功能上:MapServer弱于GeoServer,QGIS要强于UDIG. 效率上:Mapserver对WMS(Web Map service) ...
- python爬虫_简单使用百度OCR解析验证码
百度技术文档 首先要注册百度云账号: 在首页,找到图像识别,创建应用,选择相应的功能,创建 安装接口模块: pip install baidu-aip 简单识别一: 简单图形验证码: 图片: from ...
- Scrapy-Redis分布式策略
Scrapy-Redis分布式策略 原理图: 假设有四台电脑:Windows 10.Mac OS X.Ubuntu 16.04.CentOS 7.2,任意一台电脑都可以作为 Master端 或 Sla ...
- Intellij IDEA 快捷键整理-鬼畜版(全键盘开发指南)
一 .何为鬼畜? 鬼畜一词在ACG爱好者中也代指通过影片(或音讯)剪辑,用频率极高的重复画面(或声音)组合而成的一段节奏配合音画同步率极高的一类影片,而这类鬼畜影片多见于NICONICO.AcFun和 ...