net.sf.morph.context.contexts
Class HttpServletContext
java.lang.Object
net.sf.morph.context.contexts.BaseContext
net.sf.morph.context.contexts.BaseHierarchicalContext
net.sf.morph.context.contexts.ReflectorHierarchicalContext
net.sf.morph.context.contexts.HttpServletContext
- All Implemented Interfaces:
- java.util.Map, Context, DecoratedContext, DelegatingContext, HierarchicalContext
public class HttpServletContext
- extends ReflectorHierarchicalContext
Context for HTTP servlets that evaluates request parameters, request
attributes, session attributes, and application attributes, in that order.
Exposing request parameters in this manner is somewhat unusual, so
setReflectingRequestParameters(boolean)
can be
called to turn this behavior off.
This class is not threadsafe, but since usually only a single
thread is accessing a request at any given time, this should be OK.
- Since:
- Nov 29, 2004
- Author:
- Matt Sgarlata
Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry<K,V> |
Method Summary |
javax.servlet.http.HttpServletRequest |
getRequest()
|
boolean |
isReflectingRequestParameters()
|
protected void |
setHierarchicalImpl(java.lang.String propertyName,
java.lang.Object propertyValue)
This method is overridden so that set calls are always invoked on the
requestContext, since request parameters cannot be set but logically a
set call is being sent to the request, so it should succeed. |
void |
setReflectingRequestParameters(boolean reflectingRequestParameters)
|
void |
setRequest(javax.servlet.http.HttpServletRequest request)
|
Methods inherited from class net.sf.morph.context.contexts.BaseContext |
clear, containsKey, containsValue, entrySet, get, get, get, get, get, getContextMapBridge, getConverter, getLanguage, getLog, getPropertyNames, isEmpty, keySet, put, putAll, remove, set, set, setContextMapBridge, setConverter, setLanguage, setLog, size, values |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
HttpServletContext
public HttpServletContext()
HttpServletContext
public HttpServletContext(javax.servlet.http.HttpServletRequest request)
setHierarchicalImpl
protected void setHierarchicalImpl(java.lang.String propertyName,
java.lang.Object propertyValue)
throws java.lang.Exception
- This method is overridden so that set calls are always invoked on the
requestContext, since request parameters cannot be set but logically a
set call is being sent to the request, so it should succeed.
- Overrides:
setHierarchicalImpl
in class ReflectorHierarchicalContext
- Throws:
java.lang.Exception
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request)
isReflectingRequestParameters
public boolean isReflectingRequestParameters()
- Returns:
- Returns the reflectingRequestParameters.
setReflectingRequestParameters
public void setReflectingRequestParameters(boolean reflectingRequestParameters)
- Parameters:
reflectingRequestParameters
- The reflectingRequestParameters to set.
Copyright © 2004-2008.