struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Uribe (JIRA)" <j...@apache.org>
Subject [jira] Commented: (WW-1810) Custom ObjectTypeDeterminer defined in struts.properties is not correctly set in XWorkConverter
Date Tue, 13 Mar 2007 20:09:51 GMT

    [ https://issues.apache.org/struts/browse/WW-1810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40545
] 

Daniel Uribe commented on WW-1810:
----------------------------------

Here is a possible solution that I used as a patchin my Struts/XWork installation, although
I am not sure if it's the best.

Add @Inject annotation to XWorkConverter.setObjectTypeDeterminer(...) method and do a local
development build of XWork 2.0.1

> Custom ObjectTypeDeterminer defined in struts.properties is not correctly set in XWorkConverter
> -----------------------------------------------------------------------------------------------
>
>                 Key: WW-1810
>                 URL: https://issues.apache.org/struts/browse/WW-1810
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 2.0.6
>         Environment: Tomcat 5.5.17
>            Reporter: Daniel Uribe
>
> When a custom ObjectTypeDeterminer is defined in the struts.properties file as follows,
the instance of XWorkConverter (by default being AnnotationXWorkConverter) does not get its
objectTypeDeterminer property set to an instance of the custom ObjectTypeDeterminer.
> struts.objectTypeDeterminer=CustomObjectTypeDeterminer
> What seems to be happening is that the injection and instantiation of AnnotationXWorkConverter
is happening before the injection of the ObjectTypeDeterminer into the ObjectTypeDeterminerFactory.
New instances of AnnotationXWorkConverter retrieve their instance of ObjectTypeDeterminer
at initialization time by calling the ObjectTypeDeterminerFactory.getInstance() -- line 165
--, which at that moment doesn't have an instance of the custom ObjectTypeDeterminer. This
effectively prevents the use of the custom ObjectTypeDeterminer with any operation done through
OGNL, since it uses the instance that the AnnotationXWorkConverter has.

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


Mime
View raw message