You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "James Holmes (JIRA)" <ji...@apache.org> on 2008/12/11 19:37:36 UTC

[jira] Updated: (WW-2810) @Inject is hardwired for TextProvider

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

James Holmes updated WW-2810:
-----------------------------

    Fix Version/s: Future

> @Inject is hardwired for TextProvider
> -------------------------------------
>
>                 Key: WW-2810
>                 URL: https://issues.apache.org/struts/browse/WW-2810
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.1.1
>            Reporter: Scott Stanlick
>            Priority: Minor
>             Fix For: Future
>
>
> After trying to inject my own TextProvider and not getting it to work, I started looking at source.  It appears that several aspects of this configuration could use some cleaning up.  First off, TextProviderFactory creates a TextProviderSupport in the getTextProvider() method, making it impossible to inject a custom implementation.  Second, the OgnlValueStackFactory has the following injected method:
>     @Inject("system")
>     public void setTextProvider(TextProvider textProvider) {
>         this.textProvider = textProvider;
>     }
> The name "system" is coming from the struts-default.xml as follows:
>  <bean type="com.opensymphony.xwork2.TextProvider" name="system" class="com.opensymphony.xwork2.DefaultTextProvider" />
> Any attempt to override this type with the name "system" results in a duplication violation.
> It seems the right thing would be to add a struts.textProvider property and remove this hard coding.
> BTW, what is the value in having the TextProvider instance as a composite of the OgnlValueStackFactory?  It appears to be hiding in the shadow of the TextProviderSupport.
> Scott

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.