com.easyjf.web
Class ActionContext

java.lang.Object
  extended bycom.easyjf.web.ActionContext

public class ActionContext
extends java.lang.Object

Title:Servlet上下文件处理类

Description: 通过使用ThreadLocal变量,实现用户当前访问的Servlet上下文环境访问!
通过使用ActionContext,在用户的Action类可以访问servlet相关资源.如要访问session对象,直接使用ActionContext.getContext().getSession()即可!

Copyright: Copyright (c) 2006

Company: www.easyjf.com

Version:
1.0
Author:
蔡世友

Field Summary
static java.lang.String HTTP_PARAMETERS
           
static java.lang.String HTTP_REQUEST
           
static java.lang.String HTTP_RESPONSE
           
static java.lang.String HTTP_SESSION
           
 
Constructor Summary
ActionContext(java.util.Map context)
           
 
Method Summary
 java.lang.Object get(java.lang.Object key)
           
static ActionContext getContext()
          Returns the ActionContext specific to the current thread.
 java.util.Map getContextMap()
           
 java.util.Map getParameters()
           
 javax.servlet.http.HttpServletRequest getRequest()
           
 javax.servlet.http.HttpServletResponse getResponse()
           
 javax.servlet.http.HttpSession getSession()
           
 void put(java.lang.Object key, java.lang.Object value)
           
static void setContext(ActionContext context)
          Sets the action context for the current thread.
 void setContextMap(java.util.Map contextMap)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTP_REQUEST

public static final java.lang.String HTTP_REQUEST
See Also:
Constant Field Values

HTTP_RESPONSE

public static final java.lang.String HTTP_RESPONSE
See Also:
Constant Field Values

HTTP_SESSION

public static final java.lang.String HTTP_SESSION
See Also:
Constant Field Values

HTTP_PARAMETERS

public static final java.lang.String HTTP_PARAMETERS
See Also:
Constant Field Values
Constructor Detail

ActionContext

public ActionContext(java.util.Map context)
Method Detail

setContext

public static void setContext(ActionContext context)
Sets the action context for the current thread.

Parameters:
context - the action context.

getContext

public static ActionContext getContext()
Returns the ActionContext specific to the current thread.

Returns:
the ActionContext for the current thread.

setContextMap

public void setContextMap(java.util.Map contextMap)

getContextMap

public java.util.Map getContextMap()

getRequest

public javax.servlet.http.HttpServletRequest getRequest()

getResponse

public javax.servlet.http.HttpServletResponse getResponse()

getSession

public javax.servlet.http.HttpSession getSession()

getParameters

public java.util.Map getParameters()

get

public java.lang.Object get(java.lang.Object key)

put

public void put(java.lang.Object key,
                java.lang.Object value)