Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-3067

Prototypical actions

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0
    • Component/s: Core
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              pbenedict Paul Benedict
              Reporter:
              pbenedict Paul Benedict
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: