ActionContext
来源:互联网 发布:电脑顽固软件卸载 编辑:程序博客网 时间:2024/06/05 05:16
一、定义
ActionContext是Action的上下文,Struts2自动在其中保存了一些在Action执行过程中所需的对象,比如session, parameters, locale等。Struts2会根据每个执行HTTP请求的线程来创建对应的ActionContext,即一个线程有一个唯一的ActionContext。因此,使用者可以使用静态方法ActionContext.getContext()来获取当前线程的ActionContext。
二、方法简介
(1)static ActionContext getContext()
Returns the ActionContext specific to the current thread.
(2)Map<String,Object> getParameters()
Returns a Map of the HttpServletRequest parameters when in a servlet environment or a generic Map of parameters otherwise.
(3)Map<String,Object> getSession()
Gets the Map of HttpSession values when in a servlet environment or a generic session map otherwise.
(4)Map<String,Object> getApplication()
Returns a Map of the ServletContext when in a servlet environment or a generic application level Map otherwise.
(4)ValueStack getValueStack()
Gets the OGNL value stack.
(5)void put(String key, Object value)
Stores a value in the current ActionContext.
(6)Object get(java.lang.String key)
Returns a value that is stored in the current ActionContext by doing a lookup using the value's key.
- ActionContext
- actioncontext
- ActionContext
- ActionContext
- ActionContext
- ActionContext
- ActionContext
- ActionContext
- ActionContext
- ActionContext
- ActionContext
- ActionContext
- ActionContext
- ActionContext && ServletActionContext
- ActionContext && ServletActionContext
- ActionContext上下文
- struts2 ActionContext
- ActionContext && ServletActionContext
- Android Studio 和 IDEA 快捷开发
- 数据库学习纪要(二十五):MySQL-5-扩展你的表
- [Linux]锁机制
- ajax
- Linux 重定向 —— 操作符及管道线
- ActionContext
- 1.6OpenCV读取摄像头并做边缘检测
- worldline 感性认识 理性打表
- Java虚拟机运行时数据区详解
- SPOJ 1811(LCS) 后缀自动机
- HDU 4553 约会安排
- 数据结构
- java使用BZip算法压缩解压缩文件、数据流、byte[]字节数组
- URAL 1088|Ilya Murometz|位运算|满二叉树的性质|LCA