com.sun.faces.util
public class RequestStateManager extends java.lang.Object
This helper class is used a central location for per-request state that is needed by Mojarra. This class leverages FacesContext.getAttributes() which as added in 2.0 instead of the request scope to prevent the unecessary triggering of ServletREquestAttributeListeners.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTUAL_VIEW_MAP
This attribute is used by the StateMangaer during restore view.
|
static java.lang.String |
AFTER_VIEW_CONTENT
Attribute for storing any content within a page that is defined
after the closing f:view.
|
static java.lang.String |
DISABLED_VALIDATORS
Used to communicate which validators have been disabled for a particular
nesting level within a view.
|
static java.lang.String |
EL_RESOLVER_CHAIN_TYPE_NAME
Attribute describing the current ELResolver chain type (either JSP
or Faces)
|
static java.lang.String |
FACELET_FACTORY
Used to store the FaceletFactory as other components may need to
use it during their processing.
|
static java.lang.String |
FACES_VIEW_STATE
Leveraged by the RequestStateManager to allow deprecated ResponseStateManager
methods to continue to work if called.
|
static java.lang.String |
INVOCATION_PATH
Attribute to store the
FacesServlet path of
the original request. |
private static java.lang.String |
KEY
The key under with the Map containing the implementation specific
attributes will be stored within the request.
|
static java.lang.String |
LOGICAL_VIEW_MAP
This attribute is used by the StateMangaer during restore view.
|
private static java.util.Map<javax.faces.event.PhaseId,java.lang.String[]> |
PHASE_ATTRIBUTES |
static java.lang.String |
PROCESSED_RESOURCE_DEPENDENCIES
Used to store the Set of ResourceDependency annotations that have
been processed.
|
static java.lang.String |
REENTRANT_GUARD
This attribute protects against infinite loops on expressions that
touch a custom legacy VariableResolver that delegates to its parent
VariableResolver.
|
static java.lang.String |
RENDER_KIT_IMPL_REQ
Attribute defining the
RenderKit being used
for this request. |
private static java.lang.String[] |
RENDER_RESPONSE |
static java.lang.String |
RESOURCE_REQUEST
Leveraged by ResourceHandlerImpl to denote whether or not a request
is a resource request.
|
static java.lang.String |
SCRIPT_STATE
Used to indicate whether or not jsf.js has already be rendered.
|
static java.lang.String |
TARGET_COMPONENT_ATTRIBUTE_NAME
Attribute indicating the current component being processed.
|
static java.lang.String |
VIEWTAG_STACK_ATTR_NAME
This attribute is used by the loadBundle tag for tracking views/subviews
within the logical view (this is only used when 1.1 compatibility is
enabled).
|
Constructor and Description |
---|
RequestStateManager() |
Modifier and Type | Method and Description |
---|---|
static void |
clearAttributesForPhase(javax.faces.context.FacesContext ctx,
javax.faces.event.PhaseId phaseId)
Remove all request state attributes associated that need to be cleared
before the execution of a particular lifecycle phase.
|
static boolean |
containsKey(javax.faces.context.FacesContext ctx,
java.lang.String key) |
static java.lang.Object |
get(javax.faces.context.FacesContext ctx,
java.lang.String key) |
static java.util.Map<java.lang.String,java.lang.Object> |
getStateMap(javax.faces.context.FacesContext ctx) |
static java.lang.Object |
remove(javax.faces.context.FacesContext ctx,
java.lang.String key)
Remove the value associated with the specified key.
|
static void |
set(javax.faces.context.FacesContext ctx,
java.lang.String key,
java.lang.Object value)
Adds the specified key and value to the Map stored in the request.
|
public static final java.lang.String AFTER_VIEW_CONTENT
public static final java.lang.String EL_RESOLVER_CHAIN_TYPE_NAME
public static final java.lang.String TARGET_COMPONENT_ATTRIBUTE_NAME
public static final java.lang.String RENDER_KIT_IMPL_REQ
RenderKit
being used
for this request.public static final java.lang.String LOGICAL_VIEW_MAP
public static final java.lang.String ACTUAL_VIEW_MAP
public static final java.lang.String VIEWTAG_STACK_ATTR_NAME
public static final java.lang.String INVOCATION_PATH
FacesServlet
path of
the original request.public static final java.lang.String REENTRANT_GUARD
public static final java.lang.String FACES_VIEW_STATE
public static final java.lang.String RESOURCE_REQUEST
Boolean
value will be assoicated
with this key.public static final java.lang.String FACELET_FACTORY
public static final java.lang.String SCRIPT_STATE
public static final java.lang.String DISABLED_VALIDATORS
public static final java.lang.String PROCESSED_RESOURCE_DEPENDENCIES
private static final java.lang.String[] RENDER_RESPONSE
private static final java.lang.String KEY
The key under with the Map containing the implementation specific attributes will be stored within the request.
private static final java.util.Map<javax.faces.event.PhaseId,java.lang.String[]> PHASE_ATTRIBUTES
public static java.lang.Object get(javax.faces.context.FacesContext ctx, java.lang.String key)
ctx
- the FacesContext
for the current requestkey
- the key for the valuepublic static void set(javax.faces.context.FacesContext ctx, java.lang.String key, java.lang.Object value)
Adds the specified key and value to the Map stored in the request.
If value
is null
, that key/value pair will
be removed from the Map.
ctx
- the FacesContext
for the current requestkey
- the key for the valuevalue
- the value to storepublic static java.lang.Object remove(javax.faces.context.FacesContext ctx, java.lang.String key)
Remove the value associated with the specified key.
ctx
- the FacesContext
for the current requestkey
- the key for the valuepublic static void clearAttributesForPhase(javax.faces.context.FacesContext ctx, javax.faces.event.PhaseId phaseId)
Remove all request state attributes associated that need to be cleared before the execution of a particular lifecycle phase.
ctx
- the FacesContext
for the current requestphaseId
- the phase used to obtain the associated attributespublic static boolean containsKey(javax.faces.context.FacesContext ctx, java.lang.String key)
ctx
- the FacesContext
for the current requestkey
- the key for the valuepublic static java.util.Map<java.lang.String,java.lang.Object> getStateMap(javax.faces.context.FacesContext ctx)
ctx
- the FacesContext
for the current requestCopyright © 2002-2010 Oracle America, Inc. All Rights Reserved.