Struts2基础之九:result的服务器跳转和客户端跳转
来源:互联网 发布:阿里云直播demo 编辑:程序博客网 时间:2024/05/18 02:36
struts.xml 中配置action返回结果的方式:
一:跳转到页面
如果<result>标签没有指定type的话,默认是<result type="dispatcher">,也就是服务器端页面跳转
<!-- 1:服务器端跳转 --> <!-- 跳转后URL显示:还是action名(不变) --> <action name="hello1"> <result type="dispatcher"> /helloStruts2.jsp </result> </action> <!-- 2:客户端跳转 --> <!-- 跳转后URL显示:下边的jsp名(变为映射的jsp名) --> <action name="hello2"> <result type="redirect"> /helloStruts2.jsp </result> </action>
二:跳转到其他action
<!-- 1:服务器端跳转到目的action --> <!-- 跳转后URL显示:所请求的action名(不随跳转变) --> <action name="hello3"> <result type="chain"> hello1 </result> </action> <!-- 2:客户端跳转到目的action --> <!-- 跳转后URL显示:目的action的jsp名(变为映射的jsp名) --> <action name="hello4"> <result type="redirectAction"> hello1 </result> </action>
<result type="chain"><param name="actionName">dashboard</param><param name="namespace">/secure</param></result>
三:其他方式
还有stream方式(下载时候要配置),FreeMarker等方式,日后用到时候再来补充
- Struts2基础之九:result的服务器跳转和客户端跳转
- struts2服务器跳转和客户端跳转之区别
- struts2 result类型和客户端跳转,服务器端跳转
- struts2的服务器跳转、客户端跳转、跳转类型
- 服务器跳转和客户端跳转的区别
- Struts2基础之三:URL路径的跳转 和basePath
- struts2中result的type跳转类型
- struts2中result的type跳转类型
- struts2中result的type跳转类型
- 服务器跳转与客户端跳转的区别
- 服务器跳转与客户端跳转的区别
- 服务器跳转与客户端跳转的区别
- struts2 Result类型(跳转)
- struts2 Result类型(跳转)
- 客户端跳转和服务器端跳转的区别
- SpringMvc的服务器端跳转和客户端跳转
- 客户端跳转和服务器端跳转的区别
- “服务器端跳转”和“客户端跳转”的区别
- 对计算机专业的认识及期望
- 中国式教育对孩子的七大武器
- contact+枚举方法
- (转)超棒的EXCEL使用技巧
- 不同继承方式的基类和派生类特性
- Struts2基础之九:result的服务器跳转和客户端跳转
- 无开发仅做日记
- 迈瑞笔试题,递归实现字符串逆置
- 系统建模
- 【转】腾讯、百度、网易游戏、华为Offer及笔经面经
- 切分线段
- 超诡异的自杀案,有点坑爹
- break和continue的区别
- 求职那些事十