在action中将数据传给页面的三种方式
2016-03-29 21:59
204 查看
在action中将数据传给页面一共有四种方式
1 将数据放入ActionContext.getContext().put("departmentList", departmentList);
读取方式 <s:iterator value="departmentList"> <s:property value="dname"/> </s:iterator>
2 将数据放入ActionContext.getContext().getValueStack().push(departmentList); 是将数据放入栈顶
读取方式 默认是从栈顶读取<s:iterator> <s:property value="dname"/> </s:iterator>
3 将数据放入ServletActionContext.getRequet.setAttribute() 即将数据放入request中
读取方式<s:iterator value="#request.departmentList"> <s:property value="dname"/> </s:iterator>
1 将数据放入ActionContext.getContext().put("departmentList", departmentList);
读取方式 <s:iterator value="departmentList"> <s:property value="dname"/> </s:iterator>
2 将数据放入ActionContext.getContext().getValueStack().push(departmentList); 是将数据放入栈顶
读取方式 默认是从栈顶读取<s:iterator> <s:property value="dname"/> </s:iterator>
3 将数据放入ServletActionContext.getRequet.setAttribute() 即将数据放入request中
读取方式<s:iterator value="#request.departmentList"> <s:property value="dname"/> </s:iterator>
相关文章推荐
- structs笔记
- SSH2框架搭建示例
- Structs2入门篇(环境搭建及Demo)
- structs2的工作流程
- Spring整合Structs2 的web.xml 基本配置
- Spring 整合Structs
- 在Action 中读取页面传递来的数据
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)_forever
- structs2
- Struts2、hibernate和spring下载,整合所需jar包
- structs2源码分析
- Structs2参数传递
- 使用ckeditor实现在线文本编辑功能(图文+源码)①
- 采用spring+structs+hibanate框架开发javaWeb项目
- 为啥拦截器在invocation.invoke()之前的代码,将会在Action之前被依次执行,而在invocation.invoke ()之后的代码,将会在Action之后被逆序执行?
- JavaEE网上商城项目(涉及Structs2+Spring+Hibernate+jQuery)
- Structs2 输入校验,Action中校验,在xml中校验
- Structs中Action访问ServletAPI的几种方式
- structs2的web.xml中分发器FilterDispatcher和StrutsPrepareAndExecuteFilter的区别
- struts.xml学习一:常用配置