Annotation Type RenderStateScoped
-
@Retention(RUNTIME) @Target(TYPE) @NormalScope @Inherited public @interface RenderStateScoped
Provides a CDI custom scope that is scoped to the render state. The purpose of this scope is to allow portlet render parameters to be handled like beans.If an
@RenderStateScopedbean is injected into a class containing an@EventMethodor an@ActionMethod, the bean is associated with the corresponding portlet. The bean state is stored as a render parameter of the that portlet.A bean annotated with this scope must implement the
PortletSerializableinterface, which provides methods used by the portlet bean container to synchronize the bean according to the render state.An
@RenderStateScopedbean is similar to an@RequestScopedbean in that a new instance is created at the beginning of each request. However, for@RenderStateScopedScopedbeans, the portlet bean container calls thePortletSerializable#deserializemethod at the beginning of each request to initialize the bean and thePortletSerializable#serializemethod at the end of an action request or event request to obtain the serialized bean data.A
@RenderStateScopedbean must be a valid bean and must provide a default constructor.Note that only changes made to the bean state during
ActionMethodorEventMethodexecution are stored in the render state. Changes made duringRenderMethod,ServeResourceMethod, orHeaderMethodexecution will not be available during subsequent requests.- Since:
- 3.0
- See Also:
PortletSerializable
-
-
Element Detail
-
paramName
String paramName
The name of the render parameter under which the bean state is to be stored.If the name is not specified through the annotation, the portlet container will assign a render parameter name.
If this element is a public render parameter identifier as declared in the portlet application configuration, the render parameter represented by the annotated class will be treated as a public render parameter.
- Returns:
- The parameter name
- Default:
- ""
-
-