Top Description Fields Constructors Methods
com.sun.faces.util

public Class RequestStateManager

extends Object
Class Inheritance
Imports
java.util.HashMap, .Map, com.sun.faces.RIConstants, jakarta.faces.application.ResourceHandler, jakarta.faces.context.FacesContext, .PartialViewContext

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.

Field Summary

Modifier and TypeField and Description
public static final String
ACTUAL_VIEW_MAP

This attribute is used by the StateMangaer during restore view.

public static final String
AFTER_VIEW_CONTENT

Attribute for storing any content within a page that is defined after the closing f:view.

private static final String[]
public static final String
DISABLED_VALIDATORS

Used to communicate which validators have been disabled for a particular nesting level within a view.

public static final String
EL_RESOLVER_CHAIN_TYPE_NAME

Attribute describing the current ELResolver chain type

public static final String
FACELET_FACTORY

Used to store the FaceletFactory as other components may need to use it during their processing.

public static final String
FACES_VIEW_STATE

Leveraged by the RequestStateManager to allow deprecated ResponseStateManager methods to continue to work if called.

public static final String
INVOCATION_PATH

Attribute to store the jakarta.faces.webapp.FacesServlet path of the original request.

private static final String
KEY

The key under with the Map containing the implementation specific attributes will be stored within the request.

public static final String
LOGICAL_VIEW_MAP

This attribute is used by the StateMangaer during restore view.

public static final String
PROCESSED_RADIO_BUTTON_GROUPS

Used to store the Set of ResourceDependency annotations that have been processed.

public static final String
PROCESSED_RESOURCE_DEPENDENCIES

Used to store the Set of ResourceDependency annotations that have been processed.

public static final String
REENTRANT_GUARD

This attribute protects against infinite loops on expressions that touch a custom legacy VariableResolver that delegates to its parent VariableResolver.

public static final String
RENDER_KIT_IMPL_REQ

Attribute defining the jakarta.faces.render.RenderKit being used for this request.

public static final String
RENDERED_RESOURCE_DEPENDENCIES

Used to store the Set of resource dependencies that have been rendered.

public static final String
RESOURCE_REQUEST

Leveraged by ResourceHandlerImpl to denote whether or not a request is a resource request.

public static final String
SCRIPT_STATE

Used to indicate whether or not Faces script has already been installed.

public static final String
TARGET_COMPONENT_ATTRIBUTE_NAME

Attribute indicating the current component being processed.

public static final 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 Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
clearAttributesOnChangeOfView(FacesContext
the FacesContext for the current request
ctx
)

Remove all request state attributes associated that need to be cleared on change of view.

public static boolean

Returns:

true if the specified key exists in the Map
containsKey
(FacesContext
the FacesContext for the current request
ctx
,
String
the key for the value
key
)

public static <T> T

Returns:

the value associated with the specified key.
get
(FacesContext
the FacesContext for the current request
ctx
,
String
the key for the value
key
)

public static Map<String, Object>

Returns:

the Map from the request containing the implementation specific attributes needed for processing
getStateMap
(FacesContext
the FacesContext for the current request
ctx
)

public static Object

Returns:

the value previous associated with the specified key, if any
remove
(FacesContext
the FacesContext for the current request
ctx
,
String
the key for the value
key
)

Remove the value associated with the specified key.

public static void
set(FacesContext
the FacesContext for the current request
ctx
,
String
the key for the value
key
,
Object
the value to store
value
)

Adds the specified key and value to the Map stored in the request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ACTUAL_VIEW_MAPback to summary
public static final String ACTUAL_VIEW_MAP

This attribute is used by the StateMangaer during restore view. The values are stored in the request for later use.

AFTER_VIEW_CONTENTback to summary
public static final String AFTER_VIEW_CONTENT

Attribute for storing any content within a page that is defined after the closing f:view.

ATTRIBUTES_TO_CLEAR_ON_CHANGE_OF_VIEWback to summary
private static final String[] ATTRIBUTES_TO_CLEAR_ON_CHANGE_OF_VIEW
DISABLED_VALIDATORSback to summary
public static final String DISABLED_VALIDATORS

Used to communicate which validators have been disabled for a particular nesting level within a view.

EL_RESOLVER_CHAIN_TYPE_NAMEback to summary
public static final String EL_RESOLVER_CHAIN_TYPE_NAME

Attribute describing the current ELResolver chain type

FACELET_FACTORYback to summary
public static final String FACELET_FACTORY

Used to store the FaceletFactory as other components may need to use it during their processing.

FACES_VIEW_STATEback to summary
public static final String FACES_VIEW_STATE

Leveraged by the RequestStateManager to allow deprecated ResponseStateManager methods to continue to work if called.

INVOCATION_PATHback to summary
public static final String INVOCATION_PATH

Attribute to store the jakarta.faces.webapp.FacesServlet path of the original request.

KEYback to summary
private static final String KEY

The key under with the Map containing the implementation specific attributes will be stored within the request.

LOGICAL_VIEW_MAPback to summary
public static final String LOGICAL_VIEW_MAP

This attribute is used by the StateMangaer during restore view. The values are stored in the request for later use.

PROCESSED_RADIO_BUTTON_GROUPSback to summary
public static final String PROCESSED_RADIO_BUTTON_GROUPS

Used to store the Set of ResourceDependency annotations that have been processed.

PROCESSED_RESOURCE_DEPENDENCIESback to summary
public static final String PROCESSED_RESOURCE_DEPENDENCIES

Used to store the Set of ResourceDependency annotations that have been processed.

REENTRANT_GUARDback to summary
public static final String REENTRANT_GUARD

This attribute protects against infinite loops on expressions that touch a custom legacy VariableResolver that delegates to its parent VariableResolver.

RENDER_KIT_IMPL_REQback to summary
public static final String RENDER_KIT_IMPL_REQ

Attribute defining the jakarta.faces.render.RenderKit being used for this request.

RENDERED_RESOURCE_DEPENDENCIESback to summary
public static final String RENDERED_RESOURCE_DEPENDENCIES

Used to store the Set of resource dependencies that have been rendered.

RESOURCE_REQUESTback to summary
public static final String RESOURCE_REQUEST

Leveraged by ResourceHandlerImpl to denote whether or not a request is a resource request. A Boolean value will be assoicated with this key.

SCRIPT_STATEback to summary
public static final String SCRIPT_STATE

Used to indicate whether or not Faces script has already been installed.

TARGET_COMPONENT_ATTRIBUTE_NAMEback to summary
public static final String TARGET_COMPONENT_ATTRIBUTE_NAME

Attribute indicating the current component being processed. This will be used when generating bytecode for custom converters.

VIEWTAG_STACK_ATTR_NAMEback to summary
public static final 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 Detail

RequestStateManagerback to summary
public RequestStateManager()

Method Detail

clearAttributesOnChangeOfViewback to summary
public static void clearAttributesOnChangeOfView(FacesContext ctx)

Remove all request state attributes associated that need to be cleared on change of view.

Parameters
ctx:FacesContext

the FacesContext for the current request

containsKeyback to summary
public static boolean containsKey(FacesContext ctx, String key)
Parameters
ctx:FacesContext

the FacesContext for the current request

key:String

the key for the value

Returns:boolean

true if the specified key exists in the Map

getback to summary
public static <T> T get(FacesContext ctx, String key)
Parameters
ctx:FacesContext

the FacesContext for the current request

key:String

the key for the value

Returns:T

the value associated with the specified key.

Annotations
@SuppressWarnings:unchecked
getStateMapback to summary
public static Map<String, Object> getStateMap(FacesContext ctx)
Parameters
ctx:FacesContext

the FacesContext for the current request

Returns:Map<String, Object>

the Map from the request containing the implementation specific attributes needed for processing

Annotations
@SuppressWarnings:unchecked
removeback to summary
public static Object remove(FacesContext ctx, String key)

Remove the value associated with the specified key.

Parameters
ctx:FacesContext

the FacesContext for the current request

key:String

the key for the value

Returns:Object

the value previous associated with the specified key, if any

setback to summary
public 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.

Parameters
ctx:FacesContext

the FacesContext for the current request

key:String

the key for the value

value:Object

the value to store