@Retention(value=RUNTIME) @Target(value=TYPE) @NormalScope @Inherited public @interface RenderStateScoped
If an @RenderStateScoped
bean is injected into a class containing
an @EventMethod
or 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 PortletSerializable
interface,
which provides methods used by the portlet bean container to synchronize the bean
according to the render state.
An @RenderStateScoped
bean is similar to an
@RequestScoped
bean in that a new instance is created at the
beginning of each request.
However, for @RenderStateScopedScoped
beans, the portlet bean
container calls the
PortletSerializable#deserialize
method at the beginning of each request to initialize the bean and the
PortletSerializable#serialize
method
at the end of an action request or event request to obtain the serialized bean data.
A @RenderStateScoped
bean must be a valid bean and
must provide a default constructor.
Note that only changes made to the bean state during ActionMethod
or EventMethod
execution are stored in the render state.
Changes made during RenderMethod
, ServeResourceMethod
,
or HeaderMethod
execution will not be available during subsequent requests.
PortletSerializable
public abstract String paramName
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.
Java Portlet 3.0 API Specification. See the Copyright and License provided with this distribution. Use is subject to license terms.