[
https://issues.apache.org/struts/browse/STR-3067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_41390
]
Paul Benedict commented on STR-3067:
------------------------------------
One of primary benefit of prototypical actions is integration with dependency
injection frameworks that are lifecycle-aware. Spring, for instance, can create
objects per request/session and then inject them. Only if actions are
themselves per request can such a model be feasible.
Reference:
http://static.springframework.org/spring/docs/2.0.x/reference/beans.html#beans-factory-scopes
> Prototypical actions
> --------------------
>
> Key: STR-3067
> URL: https://issues.apache.org/struts/browse/STR-3067
> Project: Struts 1
> Issue Type: New Feature
> Components: Core
> Reporter: Paul Benedict
> Fix For: 1.4.0
>
>
> To better align with Struts 2 and other modern frameworks, provide a new
> attribute on ActionConfig for an instantiation policy. Initial thoughts are:
> singleton="true|false" and default to true.
> Example: If action A uses class X as a singleton, and class B uses class X as
> a prototype, and class C uses class X as a singleton, both A and C will share
> the instance, while B will receive a new action per request.
> It appears only minimal changes are needed. AbstractCreateAction delegates to
> abstract method getAction. The concrete method in CreateAction simply needs
> to first check the ActionConfig property and (a) create a new form and not
> cache for prototypes or (b) existing functionality today for singletons.
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.