Top Description Methods
javax.portlet.annotations

public @Interface RenderStateScoped

extends Annotation
Annotations
@Retention:RUNTIME
@Target:TYPE
@NormalScope
@Inherited
Imports
java.lang.annotation.Inherited, .Retention, .Target, javax.enterprise.context.NormalScope

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 @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.

Since
3.0
See Also
PortletSerializable

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The parameter name
paramName
()

The name of the render parameter under which the bean state is to be stored.
Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

paramNameback to summary
public 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:String

The parameter name