struts2 action 页面跳转
(1)type="dispatcher" 为默认,用于jsp页面跳转
<result name="success">/index.jsp</result>
完整的写法为:
<result name="success" type="dispatcher">
<param name="location">/index.jsp</param>
</result>
(2)type="redirect" 重定向到jsp、action、外部网址
<result name="success" type="redirect">/index.jsp</result>
<result name="success" type="redirect">/login.do</result>
<result name="success" type="redirect">http://www.baidu.com</result>
重定向时带参数处理方法:
1.type="redirect":
<result name="success" type="redirect">/login.do?userId=${userId }</result>
2.type="redirect-action":
见(3)
(3)type="redirect-action" 重定向到另外一个action
<result name="success" type="redirect-action">
<param name="actionName">login.do</param> 重定向action名
<param name="userId">userId</param>带的参数
转自:http://sky-chi.iteye.com/blog/1487134
</result>
(4)type="chain" 用于action跳转。
<action name="action1" class="org.Action1">
<result name="success" type="chain">action2.do</result>
</action>
<action name="action2" class="org.Action2">
<result name="success">login.jsp</result>
</action>
(5)type="plaintextj" 跳转显示源代码
<result name="err" type="plaintext">
<param name="location">具体的位置</param>
<param name="charSet">字符规范(如GBK)</param>
</result>
struts2 action 页面跳转的更多相关文章
- odoo开发笔记--自定义server action页面跳转注意
场景描述: 在添加自定义服务器动作 “复制全部”后发现直接创建了新的记录,并且直接进入到form保存完的状态. 如何解决: if yourself_obj_copy: return { 'type': ...
- struts2 action 页面与action参数的传递的三种方式
第一种: 初始页面: <form action="LoginAction.action" method="post"> 用户名:<input ...
- struts2 - View页面中获取Action的成员变量
struts2 - View页面中获取Action的成员变量 2016年03月02日 11:04:44 IT男青年 阅读数:1074 View页面中获取Action的成员变量 按照Struts的设 ...
- Struts2中的页面跳转
内容源自:Struts2中的页面跳转 一.全局页面的设置如果<package>包中的一些action都返回success,并且返回的页面都是同一个JSP页面,这样就可以配置全局的结果页面. ...
- 关于使用struts2时子窗体页面跳转后在父窗体打开的问题以及Session过期后的页面跳转问题
问题1:传统的系统界面,iframe了三个页面,上,左,右,用户点击注销的按钮在上面得top.jsp里面,方法:<a href="../adminAction/admin_logout ...
- 访问struts2的action页面出现白板问题
访问struts2的action页面出现白板问题 故需要设置拦截此action的拦截栈, <bean id="authenticationInterceptor" class ...
- Struts2(四)——页面相关内容
上篇博客总结了数据流转各个方面的内容,这篇重点说一下框架对于界面上知识. 一,说到页面,记得在总体介绍中,说到Struts2比Struts1的一方面优势就是它支持更多的视图技术(Freemarker, ...
- struts2 action result type类型
struts2 action result type类型 1.chain:用来处理Action链,被跳转的action中仍能获取上个页面的值,如request信息. com.opensymphony. ...
- jQuery动态创建form表单并提交到后台(携带一定的数据进行页面跳转)
今天遇到这么一个需求,携带一个编号一个名字跳转到另一个JSP页面,直接页面跳转(get携带数据)的话不太安全,于是想到到后台转发一下. 第一种:直接以表单提交方式的进行 JS代码: var form ...
随机推荐
- C# — FileHandler
学会使用OpenFileDialog和SaveFileDialog控件浏览和选择文件.使用System.IO.File和System.IO.Directory的对象来操纵文件系统(文件和目录). 在F ...
- 机器学习实战--logistic回归
#encoding:utf-8 from numpy import * def loadDataSet(): #加载数据 dataMat = []; labelMat = [] fr = open(' ...
- window.execScript的兼容性写法
把探嗅浏览器的操作提前到代码加载的时候,在代码加载的时候就立刻进行一次判断,以便让globalEval返回一个包裹了正确逻辑的函数 var globalEval = (function(){ var ...
- zookeeper多节点配置
单机多节点模式 zookeeper解压, 放到 /opt/zookeeper/ 下, 同目录再放一个 server1目录, 下面建data和log两个目录用于存放数据和日志 zoo.cfg [milt ...
- Broadmann分区
来源: http://blog.sina.com.cn/s/blog_60a751620100k2hj.html Brodmann areas Name 中文名 Function 1 Somatose ...
- Protocol in Objective-C
Objecttive-C Protocal 相似 Java Interface
- 如果动态设置json对象的key
项目中要求动态设置json的key属性,如果按照一般的json设置方法是不行的.假如你把一个key设置为一个变量的话,那么最后js解析出来的就是key为这个变量名而不是这个变量的值. 解决:通过使用 ...
- 清北学堂2017NOIP冬令营入学测试
P4744 A's problem(a) 时间: 1000ms / 空间: 655360KiB / Java类名: Main 背景 冬令营入学测试题,每三天结算一次成绩.参与享优惠 描述 这是一道有背 ...
- 实用工具 : Xaml Power Toys
最近挺忙, 憋了一肚子的东西没有分享. 今天分享一个 Xamarin.Forms / WPF 的增强工具 , Visual Studio 扩展 : Xaml Power Toy 可以直接在 VS201 ...
- 基于Laravel+Swoole开发智能家居后端
基于Laravel+Swoole开发智能家居后端 在上一篇<Laravel如何优雅的使用Swoole>中我已经大概谈到了Laravel结合Swoole的用法. 今天,我参与的智能家居项目基 ...