Simple action that delegates to a bean that is managed in a stateful scope.
The target of this action can be any object (and generally should be
serializable). The target may hold modifiable state as instance members in a
thread safe manner.
The resolved bean name will be treated as the identifier of a prototype bean
definition in the configured bean factory to retrieve, as well as the name of
the attribute to expose the bean in under the configured
scope . Subsequent requests to invoke this action
will pull the cached bean instance from the scope.
Note: this action is not ideal for cases when the target bean manages
transient references. This is because the bean instance is placed directly
into a scope eligible for serialization between requests. Consider a
memento-based or metadata-driven based strategy for selectively storing
serializable fields separately from the bean itself when you mix transient
and serializable references within the same stateful object.
The resolved bean name will be treated as the identifier of a prototype bean definition in the configured bean factory to retrieve, as well as the name of the attribute to expose the bean in under the configured scope . Subsequent requests to invoke this action will pull the cached bean instance from the scope.
Example:
<action-state id="executeMethod"> <action bean="myAction" method="myActionMethod"> <attribute name="stateful" value="true"/> </action> </action-state>Note: this action is not ideal for cases when the target bean manages transient references. This is because the bean instance is placed directly into a scope eligible for serialization between requests. Consider a memento-based or metadata-driven based strategy for selectively storing serializable fields separately from the bean itself when you mix transient and serializable references within the same stateful object.