result type 4常用4种类型
来源:互联网 发布:linux系统while循环 编辑:程序博客网 时间:2024/05/01 03:25
在struts2中常见的4种result type分别为:dispatcher,redirect,chain,redirectAction。
1)其中dispatcher是请求转发,相当于forward。
2)redirect就是重定向了。
3)chain是转发到action,不能指定于jsp。
4)redirectAction是重定向到一个action。
配置文件例子如下:
工程结构(还不让上传图片,只好用txt格式了):
-Struts2_Hello
-src
-com.action
ActionTest.java
struts.xml
-WebRoot
+META-INF
+WEB-INF
index.jsp
r1.jsp
r2.jsp
r3.jsp
r4.jsp
在index.jsp页面中,有如下连接:
接下来访问第一个链接URL地址为:/test1,可以看出是请求转发。
第二个链接URL地址为:/r2.jsp,重定向。
第三个链接URL地址为:/test3,请求转发,页面显示r1的内容,因为test3,转发到test1的action。
第四个链接URL地址为:/r2.jsp,重定向到test2,故页面内容显示为r2.jsp的内容
- result type 4常用4种类型
- struts2 result 几种类型
- result - type 的四种常用类型
- result type
- result: type
- result type
- 8、result类型,常用4种
- 面对不同种类的处理结果——<result type="">
- struts2中常用Result类型(type)的用法
- struts2中常用Result类型type的用法
- struts2中常用Result类型type的用法
- Socket常用几种类型
- c++4种类型转换
- c++ 4种类型转换
- C++4种类型转换
- C++4种类型转换
- REST服务4种类型
- NAT的4种类型
- typename 一个用法
- ubuntu 9.10 下安装ORACLE 出错SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
- [project]shark
- (C77)[こすぷれ喫茶娘々]東方鎖宝録 汉化补丁
- ubuntu 修改或创建交换分区的大小。
- result type 4常用4种类型
- 今天是新的一页了....
- 实战Active Directory站点部署与管理,Active Directory系列之十二
- Oracle中大批量删除数据的方法
- 设计模式 举例理解
- 迷宫程序
- UVa 167 - The Sultan's Successors
- fedora11 中文输入法设定
- 我们对西方文明的悲剧性误读zz