|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
org.apache.commons.chain.impl.ContextBase
org.apache.commons.chain.web.WebContext
org.apache.commons.chain.web.servlet.ServletWebContext
Concrete implementation of WebContext
suitable for use in
Servlets and JSP pages. The abstract methods are mapped to the appropriate
collections of the underlying servlet context, request, and response
instances that are passed to the constructor (or the initialize method).
Nested Class Summary |
Nested classes inherited from class java.util.Map |
Map.Entry |
Field Summary | |
protected javax.servlet.ServletContext |
context
The ServletContext for this web application. |
protected javax.servlet.http.HttpServletRequest |
request
The HttpServletRequest for this request. |
protected javax.servlet.http.HttpServletResponse |
response
The HttpServletResponse for this request. |
Constructor Summary | |
ServletWebContext()
Construct an uninitialized ServletWebContext instance. |
|
ServletWebContext(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Construct a ServletWebContext instance that is initialized
with the specified Servlet API objects. |
Method Summary | |
Map |
getApplicationScope()
Return a mutable Map that maps application scope
attribute names to their values. |
javax.servlet.ServletContext |
getContext()
Return the ServletContext for this context. |
Map |
getHeader()
Return an immutable Map that maps header names to
the first (or only) header value (as a String). |
Map |
getHeaderValues()
Return an immutable Map that maps header names to
the set of all values specified in the request (as a String array). |
Map |
getInitParam()
Return an immutable Map that maps context application
initialization parameters to their values. |
Map |
getParam()
Return an immutable Map that maps request parameter
names to the first (or only) value (as a String). |
Map |
getParamValues()
Return an immutable Map that maps request parameter
names to the set of all values (as a String array). |
javax.servlet.http.HttpServletRequest |
getRequest()
Return the HttpServletRequest for this context. |
Map |
getRequestScope()
Return a mutable Map that maps request scope
attribute names to their values. |
javax.servlet.http.HttpServletResponse |
getResponse()
Return the HttpServletResponse for this context. |
Map |
getSessionScope()
Return a mutable Map that maps session scope
attribute names to their values. |
void |
initialize(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initialize (or reinitialize) this ServletWebContext instance
for the specified Servlet API objects. |
void |
release()
Release references to allocated resources acquired in initialize() of via subsequent processing. |
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, containsKey, size |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
containsKey, equals, hashCode, size |
Field Detail |
protected javax.servlet.ServletContext context
The ServletContext
for this web application.
protected javax.servlet.http.HttpServletRequest request
The HttpServletRequest
for this request.
protected javax.servlet.http.HttpServletResponse response
The HttpServletResponse
for this request.
Constructor Detail |
public ServletWebContext()
Construct an uninitialized ServletWebContext
instance.
public ServletWebContext(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Construct a ServletWebContext
instance that is initialized
with the specified Servlet API objects.
context
- The ServletContext
for this web applicationrequest
- The HttpServletRequest
for this requestresponse
- The HttpServletResponse
for this requestMethod Detail |
public javax.servlet.ServletContext getContext()
Return the ServletContext
for this context.
public javax.servlet.http.HttpServletRequest getRequest()
Return the HttpServletRequest
for this context.
public javax.servlet.http.HttpServletResponse getResponse()
Return the HttpServletResponse
for this context.
public void initialize(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Initialize (or reinitialize) this ServletWebContext
instance
for the specified Servlet API objects.
context
- The ServletContext
for this web applicationrequest
- The HttpServletRequest
for this requestresponse
- The HttpServletResponse
for this requestpublic void release()
Release references to allocated resources acquired in
initialize()
of via subsequent processing. After this
method is called, subsequent calls to any other method than
initialize()
will return undefined results.
public Map getApplicationScope()
WebContext
Return a mutable Map
that maps application scope
attribute names to their values.
getApplicationScope
in class WebContext
public Map getHeader()
WebContext
Return an immutable Map
that maps header names to
the first (or only) header value (as a String). Header names must
be matched in a case-insensitive manner.
getHeader
in class WebContext
public Map getHeaderValues()
WebContext
Return an immutable Map
that 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.
getHeaderValues
in class WebContext
public Map getInitParam()
WebContext
Return an immutable Map
that maps context application
initialization parameters to their values.
getInitParam
in class WebContext
public Map getParam()
WebContext
Return an immutable Map
that maps request parameter
names to the first (or only) value (as a String).
getParam
in class WebContext
public Map getParamValues()
WebContext
Return an immutable Map
that maps request parameter
names to the set of all values (as a String array).
getParamValues
in class WebContext
public Map getRequestScope()
WebContext
Return a mutable Map
that maps request scope
attribute names to their values.
getRequestScope
in class WebContext
public Map getSessionScope()
WebContext
Return a mutable Map
that maps session scope
attribute names to their values.
getSessionScope
in class WebContext
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |