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 ...
随机推荐
- Java 8特性探究(1):通往lambda之路与 lambda表达式10个示例
本文由 ImportNew 函数式接口 函数式接口(functional interface 也叫功能性接口,其实是同一个东西).简单来说,函数式接口是只包含一个方法的接口.比如Java标准库中的ja ...
- javascript实现优先队列
1.概念 一般情况下从队列中删除元素,都是率先入队的元素.但是有些使用队列的情况不遵循先进先出的原则,这就是插队,这需要使用优选队列的数据结构来进行描述. 从优先队列中删除元素的时候,需要考虑优先级的 ...
- java script 确认框
<input name="Submit" type="submit" class="inputedit" value="删除 ...
- indows 8上强制Visual Studio以管理员身份运行
http://diaosbook.com/Post/2013/2/28/force-visual-studio-always-run-as-admin-on-windows-8 Windows 8的一 ...
- C语言 自动修改文件名小程序
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <stri ...
- mvc5+ef6+Bootstrap 项目心得--创立之初
1.mvc5+ef6+Bootstrap 项目心得--创立之初 2.mvc5+ef6+Bootstrap 项目心得--身份验证和权限管理 3.mvc5+ef6+Bootstrap 项目心得--WebG ...
- .NET基于Redis缓存实现单点登录SSO的解决方案
一.基本概念 最近公司的多个业务系统要统一整合使用同一个登录,这就是我们耳熟能详的单点登录,现在就NET基于Redis缓存实现单点登录做一个简单的分享. 单点登录(Single Sign On),简称 ...
- 我开源了一个ios应用,你们拿去随便玩
今天开源一个ios应用,自己写的,你们拿去随便玩.地址是: https://github.com/huijimuhe/prankPro 光拿来玩不理清个来龙去脉玩的也不开心是吧,那我就给你们摆摆来龙去 ...
- [BZOJ1528][POI2005]sam-Toy Cars(贪心)
题目:http://www.lydsy.com:808/JudgeOnline/problem.php?id=1528 分析:这个贪心很好想,因为每次如果加入一种玩具,那么必须要删掉一种玩具,就变成了 ...
- 详解C语言的htons和htonl函数、大尾端、小尾端
在Linux和Windows网络编程时需要用到htons和htonl函数,用来将主机字节顺序转换为网络字节顺序. 在Intel机器下,执行以下程序 int main(){ printf(" ...