Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3257

Get Controller bean from Spring

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1.6
    • Fix Version/s: 3.0
    • Labels:
      None

      Description

      Because of the automatic configuration of actions, when using StrutsSpringObjectFactory, the Controller objects are not created by Spring, thus the dependencies of the Controller are not injected.

      The workaround that I did was to write a new Class that extends StrutsSpringObjectFactory and override the method buildBean(Class clazz, Map<String, Object> extraContext) to get the Controller bean from appContext if the clazz is the Controller class.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              antonius Antonius Ng
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: