net.sf.morph.context.contexts
Class HttpServletContext

java.lang.Object
  extended by net.sf.morph.context.contexts.BaseContext
      extended by net.sf.morph.context.contexts.BaseHierarchicalContext
          extended by net.sf.morph.context.contexts.ReflectorHierarchicalContext
              extended by 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 Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
HttpServletContext()
           
HttpServletContext(javax.servlet.http.HttpServletRequest request)
           
 
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.ReflectorHierarchicalContext
checkConfiguration, getBeanReflector, getDelegate, getHierarchicalImpl, getPropertyNamesHierarchicalImpl, setBeanReflector, setDelegate
 
Methods inherited from class net.sf.morph.context.contexts.BaseHierarchicalContext
getImpl, getParentContext, getPropertyNamesImpl, setImpl, setParentContext
 
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 net.sf.morph.context.HierarchicalContext
get, getParentContext, getPropertyNames, set, setParentContext
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

HttpServletContext

public HttpServletContext()

HttpServletContext

public HttpServletContext(javax.servlet.http.HttpServletRequest request)
Method Detail

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.