public class RequestStateManager extends 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 String |
ACTUAL_VIEW_MAP
This attribute is used by the StateMangaer during restore view.
|
static String |
AFTER_VIEW_CONTENT
Attribute for storing any content within a page that is defined
after the closing f:view.
|
static String |
DISABLED_VALIDATORS
Used to communicate which validators have been disabled for a particular
nesting level within a view.
|
static String |
EL_RESOLVER_CHAIN_TYPE_NAME
Attribute describing the current ELResolver chain type (either JSP
or Faces)
|
static String |
FACELET_FACTORY
Used to store the FaceletFactory as other components may need to
use it during their processing.
|
static String |
FACES_VIEW_STATE
Leveraged by the RequestStateManager to allow deprecated ResponseStateManager
methods to continue to work if called.
|
static String |
INVOCATION_PATH
Attribute to store the
FacesServlet path of
the original request. |
static String |
LOGICAL_VIEW_MAP
This attribute is used by the StateMangaer during restore view.
|
static String |
PROCESSED_RADIO_BUTTON_GROUPS
Used to store the Set of ResourceDependency annotations that have
been processed.
|
static String |
PROCESSED_RESOURCE_DEPENDENCIES
Used to store the Set of ResourceDependency annotations that have
been processed.
|
static String |
REENTRANT_GUARD
This attribute protects against infinite loops on expressions that
touch a custom legacy VariableResolver that delegates to its parent
VariableResolver.
|
static String |
RENDER_KIT_IMPL_REQ
Attribute defining the
RenderKit being used
for this request. |
static String |
RENDERED_RESOURCE_DEPENDENCIES
Used to store the Set of resource dependencies that have been rendered.
|
static String |
RESOURCE_REQUEST
Leveraged by ResourceHandlerImpl to denote whether or not a request
is a resource request.
|
static String |
SCRIPT_STATE
Used to indicate whether or not JSF script has already been installed.
|
static String |
TARGET_COMPONENT_ATTRIBUTE_NAME
Attribute indicating the current component being processed.
|
static 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 |
clearAttributesOnChangeOfView(FacesContext ctx)
Remove all request state attributes associated that need to be cleared
on change of view.
|
static boolean |
containsKey(FacesContext ctx,
String key) |
static <T> T |
get(FacesContext ctx,
String key) |
static Map<String,Object> |
getStateMap(FacesContext ctx) |
static Object |
remove(FacesContext ctx,
String key)
Remove the value associated with the specified key.
|
static void |
set(FacesContext ctx,
String key,
Object value)
Adds the specified key and value to the Map stored in the request.
|
public static final String AFTER_VIEW_CONTENT
public static final String EL_RESOLVER_CHAIN_TYPE_NAME
public static final String TARGET_COMPONENT_ATTRIBUTE_NAME
public static final String RENDER_KIT_IMPL_REQ
RenderKit
being used
for this request.public static final String LOGICAL_VIEW_MAP
public static final String ACTUAL_VIEW_MAP
public static final String VIEWTAG_STACK_ATTR_NAME
public static final String INVOCATION_PATH
FacesServlet
path of
the original request.public static final String REENTRANT_GUARD
public static final String FACES_VIEW_STATE
public static final String RESOURCE_REQUEST
Boolean
value will be assoicated
with this key.public static final String FACELET_FACTORY
public static final String SCRIPT_STATE
public static final String DISABLED_VALIDATORS
public static final String PROCESSED_RESOURCE_DEPENDENCIES
public static final String PROCESSED_RADIO_BUTTON_GROUPS
public static final String RENDERED_RESOURCE_DEPENDENCIES
public static <T> T get(FacesContext ctx, String key)
ctx
- the FacesContext
for the current requestkey
- the key for the valuepublic static void set(FacesContext ctx, String key, 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 Object remove(FacesContext ctx, String key)
Remove the value associated with the specified key.
ctx
- the FacesContext
for the current requestkey
- the key for the valuepublic static void clearAttributesOnChangeOfView(FacesContext ctx)
Remove all request state attributes associated that need to be cleared on change of view.
ctx
- the FacesContext
for the current requestpublic static boolean containsKey(FacesContext ctx, String key)
ctx
- the FacesContext
for the current requestkey
- the key for the valuepublic static Map<String,Object> getStateMap(FacesContext ctx)
ctx
- the FacesContext
for the current requestComments to: faces-dev@eclipse.org.
Copyright © 2019 Eclipse Foundation. All rights reserved.
Use is subject to license terms.