You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Jira)" <ji...@apache.org> on 2022/10/22 13:49:00 UTC

[jira] [Updated] (WW-3257) Get Controller bean from Spring

     [ https://issues.apache.org/jira/browse/WW-3257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart updated WW-3257:
------------------------------
    Fix Version/s: 7.0.0
                       (was: 6.1.0)

> Get Controller bean from Spring
> -------------------------------
>
>                 Key: WW-3257
>                 URL: https://issues.apache.org/jira/browse/WW-3257
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - REST, Plugin - Spring
>    Affects Versions: 2.1.6
>            Reporter: Antonius Ng
>            Priority: Minor
>             Fix For: 7.0.0
>
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)