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

Lukasz Lenart commented on WW-3905:
-----------------------------------

I'm not sure if I follow you, using ActionContext isn't the best practise as 
thus tides your code with framework internals and can be hard to test.

You can use dedicated interceptor (interceptors are created by ObjectFactory as 
well) and used it to inject your CustomTextProvider onto action. The 
interceptor has access to request and 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

Reply via email to