Class WebContext
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap
-
- org.apache.commons.chain.impl.ContextBase
-
- org.apache.commons.chain.web.WebContext
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map,Context
- Direct Known Subclasses:
PortletWebContext,ServletWebContext
public abstract class WebContext extends ContextBase
Abstract base implementation of
Contextthat provides web based applications that use it a "generic" view of HTTP related requests and responses, without tying the application to a particular underlying Java API (such as servlets). It is expected that a concrete subclass ofWebContextfor each API (such asServletWebContext) will support adapting that particular API's implementation of request and response objects into this generic framework.The characteristics of a web request/response are made visible via a series of JavaBeans properties (and mapped to read-only attributes of the same name, as supported by
ContextBase.- Version:
- $Revision: 480477 $ $Date: 2006-11-29 08:34:52 +0000 (Wed, 29 Nov 2006) $
- Author:
- Craig R. McClanahan
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WebContext()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract java.util.MapgetApplicationScope()Return a mutableMapthat maps application scope attribute names to their values.abstract java.util.MapgetCookies()Return an immutableMapthat maps cookie names to the set of cookies specified in the request.abstract java.util.MapgetHeader()Return an immutableMapthat maps header names to the first (or only) header value (as a String).abstract java.util.MapgetHeaderValues()Return an immutableMapthat maps header names to the set of all values specified in the request (as a String array).abstract java.util.MapgetInitParam()Return an immutableMapthat maps context application initialization parameters to their values.abstract java.util.MapgetParam()Return an immutableMapthat maps request parameter names to the first (or only) value (as a String).abstract java.util.MapgetParamValues()Return an immutableMapthat maps request parameter names to the set of all values (as a String array).abstract java.util.MapgetRequestScope()Return a mutableMapthat maps request scope attribute names to their values.abstract java.util.MapgetSessionScope()Return a mutableMapthat maps session scope attribute names to their values.-
Methods inherited from class org.apache.commons.chain.impl.ContextBase
clear, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll, size
-
-
-
-
Method Detail
-
getApplicationScope
public abstract java.util.Map getApplicationScope()
Return a mutable
Mapthat maps application scope attribute names to their values.- Returns:
- Application scope Map.
-
getHeader
public abstract java.util.Map getHeader()
Return an immutable
Mapthat maps header names to the first (or only) header value (as a String). Header names must be matched in a case-insensitive manner.- Returns:
- Header values Map.
-
getHeaderValues
public abstract java.util.Map getHeaderValues()
Return an immutable
Mapthat maps header names to the set of all values specified in the request (as a String array). Header names must be matched in a case-insensitive manner.- Returns:
- Header values Map.
-
getInitParam
public abstract java.util.Map getInitParam()
Return an immutable
Mapthat maps context application initialization parameters to their values.- Returns:
- Initialization parameter Map.
-
getParam
public abstract java.util.Map getParam()
Return an immutable
Mapthat maps request parameter names to the first (or only) value (as a String).- Returns:
- Request parameter Map.
-
getParamValues
public abstract java.util.Map getParamValues()
Return an immutable
Mapthat maps request parameter names to the set of all values (as a String array).- Returns:
- Request parameter Map.
-
getCookies
public abstract java.util.Map getCookies()
Return an immutable
Mapthat maps cookie names to the set of cookies specified in the request.- Returns:
- Map of Cookies.
- Since:
- Chain 1.1
-
getRequestScope
public abstract java.util.Map getRequestScope()
Return a mutable
Mapthat maps request scope attribute names to their values.- Returns:
- Request scope Map.
-
getSessionScope
public abstract java.util.Map getSessionScope()
Return a mutable
Mapthat maps session scope attribute names to their values.- Returns:
- Session scope Map.
-
-