public class PortletWebContext extends WebContext
Concrete implementation of WebContext
suitable for use in
portlets. The abstract methods are mapped to the appropriate
collections of the underlying portlet context, request, and response
instances that are passed to the constructor (or the initialize method).
Modifier and Type | Field and Description |
---|---|
private java.util.Map |
applicationScope
The lazily instantiated
Map of application scope
attributes. |
protected javax.portlet.PortletContext |
context
The
PortletContext for this web application. |
private java.util.Map |
header
The lazily instantiated
Map of header name-value
combinations (immutable). |
private java.util.Map |
headerValues
The lazily instantitated
Map of header name-values
combinations (immutable). |
private java.util.Map |
initParam
The lazily instantiated
Map of context initialization
parameters. |
private java.util.Map |
param
The lazily instantiated
Map of request
parameter name-value. |
private java.util.Map |
paramValues
The lazily instantiated
Map of request
parameter name-values. |
protected javax.portlet.PortletRequest |
request
The
PortletRequest for this request. |
private java.util.Map |
requestScope
The lazily instantiated
Map of request scope
attributes. |
protected javax.portlet.PortletResponse |
response
The
PortletResponse for this request. |
private java.util.Map |
sessionScope
The lazily instantiated
Map of session scope
attributes. |
Constructor and Description |
---|
PortletWebContext()
Construct an uninitialized
PortletWebContext instance. |
PortletWebContext(javax.portlet.PortletContext context,
javax.portlet.PortletRequest request,
javax.portlet.PortletResponse response)
Construct a
PortletWebContext instance that is initialized
with the specified Portlet API objects. |
Modifier and Type | Method and Description |
---|---|
java.util.Map |
getApplicationScope()
See the
WebContext 's Javadoc. |
javax.portlet.PortletContext |
getContext()
Return the
PortletContext for this context. |
java.util.Map |
getCookies()
Returns an empty Map - portlets don't support Cookies.
|
java.util.Map |
getHeader()
See the
WebContext 's Javadoc. |
java.util.Map |
getHeaderValues()
See the
WebContext 's Javadoc. |
java.util.Map |
getInitParam()
See the
WebContext 's Javadoc. |
java.util.Map |
getParam()
See the
WebContext 's Javadoc. |
java.util.Map |
getParamValues()
See the
WebContext 's Javadoc. |
javax.portlet.PortletRequest |
getRequest()
Return the
PortletRequest for this context. |
java.util.Map |
getRequestScope()
See the
WebContext 's Javadoc. |
javax.portlet.PortletResponse |
getResponse()
Return the
PortletResponse for this context. |
java.util.Map |
getSessionScope()
See the
WebContext 's Javadoc. |
void |
initialize(javax.portlet.PortletContext context,
javax.portlet.PortletRequest request,
javax.portlet.PortletResponse response)
Initialize (or reinitialize) this
PortletWebContext instance
for the specified Portlet API objects. |
void |
release()
Release references to allocated resources acquired in
initialize() of via subsequent processing. |
clear, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll, size
private java.util.Map applicationScope
The lazily instantiated Map
of application scope
attributes.
protected javax.portlet.PortletContext context
The PortletContext
for this web application.
private java.util.Map header
The lazily instantiated Map
of header name-value
combinations (immutable).
private java.util.Map headerValues
The lazily instantitated Map
of header name-values
combinations (immutable).
private java.util.Map initParam
The lazily instantiated Map
of context initialization
parameters.
private java.util.Map param
The lazily instantiated Map
of request
parameter name-value.
private java.util.Map paramValues
The lazily instantiated Map
of request
parameter name-values.
protected javax.portlet.PortletRequest request
The PortletRequest
for this request.
private java.util.Map requestScope
The lazily instantiated Map
of request scope
attributes.
protected javax.portlet.PortletResponse response
The PortletResponse
for this request.
private java.util.Map sessionScope
The lazily instantiated Map
of session scope
attributes.
public PortletWebContext()
Construct an uninitialized PortletWebContext
instance.
public PortletWebContext(javax.portlet.PortletContext context, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response)
Construct a PortletWebContext
instance that is initialized
with the specified Portlet API objects.
context
- The PortletContext
for this web applicationrequest
- The PortletRequest
for this requestresponse
- The PortletResponse
for this requestpublic javax.portlet.PortletContext getContext()
Return the PortletContext
for this context.
PortletContext
for this requestpublic javax.portlet.PortletRequest getRequest()
Return the PortletRequest
for this context.
PortletRequest
for this context.public javax.portlet.PortletResponse getResponse()
Return the PortletResponse
for this context.
PortletResponse
for this context.public void initialize(javax.portlet.PortletContext context, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response)
Initialize (or reinitialize) this PortletWebContext
instance
for the specified Portlet API objects.
context
- The PortletContext
for this web applicationrequest
- The PortletRequest
for this requestresponse
- The PortletResponse
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 java.util.Map getApplicationScope()
WebContext
's Javadoc.getApplicationScope
in class WebContext
public java.util.Map getHeader()
WebContext
's Javadoc.getHeader
in class WebContext
public java.util.Map getHeaderValues()
WebContext
's Javadoc.getHeaderValues
in class WebContext
public java.util.Map getInitParam()
WebContext
's Javadoc.getInitParam
in class WebContext
public java.util.Map getParam()
WebContext
's Javadoc.getParam
in class WebContext
public java.util.Map getParamValues()
WebContext
's Javadoc.getParamValues
in class WebContext
public java.util.Map getCookies()
getCookies
in class WebContext
public java.util.Map getRequestScope()
WebContext
's Javadoc.getRequestScope
in class WebContext
public java.util.Map getSessionScope()
WebContext
's Javadoc.getSessionScope
in class WebContext