struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chad davis (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-3905) The TextProvider injection in ActionSupport isn't quite integrated into the framework's core DI
Date Fri, 19 Oct 2012 15:24:11 GMT

    [ https://issues.apache.org/jira/browse/WW-3905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480078#comment-13480078
] 

chad davis commented on WW-3905:
--------------------------------

So, if we do it this way, which looks great to me . . . then how do I configure the DI to
inject the current Action.  The TextProviderSupport needs contextual stuff from the current
action, clazz and localeProvider.  Also, my CustomTextProviderSupport use case requires the
action, as another type of provider similar to localeProvider ( a "component" provider that
provides access to the component from our system related to the current request ).  So, wiring
these current action bits into the textSupport still eludes me.  

With this proposed fix, I would hope to enable all of this wiring as injections into my CustomTextSupport
configured in my DI meta data.  But I don't know how it works to reference the "current action"
from this pre-runtime situation.  Perhaps this is the wrong approach . . . perhaps I should
be writing my CustomTextSupport so that it know's how to find it's resources in the ActionContext
or ValueStack, similar to how you obtain the ObjectFactory with the getInstance method above.
 Can I do something like this to obtain the current Action? 
                
> The TextProvider injection in ActionSupport isn't quite integrated into the framework's
core DI 
> ------------------------------------------------------------------------------------------------
>
>                 Key: WW-3905
>                 URL: https://issues.apache.org/jira/browse/WW-3905
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.3.4.1
>            Reporter: chad davis
>              Labels: ActionSupport, DependencyInjection, TextProvider
>             Fix For: 2.3.6
>
>
> The injection of the TextProvider into ActionSupport occurs via a lazy initialization
in the getTextProvider() method.  This method obtains the TextProvider from a factory that
has the implementation injected into it via  the core di mechanism.  The problem with this
is that ActionSupport programmatically does the injection using it's reference to the core
ContainerImpl.  This makes it impossible to use the Spring plugin's SpringObjectFactory to
manage this TextProvider.    

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message