You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Musachy Barroso (JIRA)" <ji...@apache.org> on 2009/03/31 19:04:03 UTC

[jira] Resolved: (WW-2367) Custom StrutsTypeConverter's convertToString not called

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

Musachy Barroso resolved WW-2367.
---------------------------------

    Resolution: Fixed

Fixed in struts trunk. If you can't use head, you can overwrite the simple.ftl template with this patch:

Index: select.ftl
===================================================================
--- select.ftl  (revision 758256)
+++ select.ftl  (working copy)
@@ -60,14 +60,14 @@
         <#if parameters.listKey??>
             <#if stack.findValue(parameters.listKey)??>
               <#assign itemKey = stack.findValue(parameters.listKey)/>
-              <#assign itemKeyStr = itemKey.toString()/>
+              <#assign itemKeyStr = stack.findString(parameters.listKey)/>
             <#else>
               <#assign itemKey = ''/>
               <#assign itemKeyStr = ''/>
             </#if>
         <#else>
             <#assign itemKey = stack.findValue('top')/>
-            <#assign itemKeyStr = itemKey.toString()/>
+            <#assign itemKeyStr = stack.findString('top')>
         </#if>
         <#if parameters.listValue??>
             <#if stack.findString(parameters.listValue)??>

> Custom StrutsTypeConverter's convertToString not called
> -------------------------------------------------------
>
>                 Key: WW-2367
>                 URL: https://issues.apache.org/struts/browse/WW-2367
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.0.11.2, 2.1.3
>            Reporter: Bob Tiernay
>            Priority: Critical
>             Fix For: 2.1.7
>
>
> It appears as though a class that is registered in xwork-conversion.properties that extends StrutsTypeConverter will never have it's convertToString method invoked as part of the normal ognl processing.  This is most evident in the case of a converter that is required in a <s:select> tag.  
> An interesting thing to note is that XWorkConverter is being invoked rather than StrutsTypeConverter.  Also TextParseUtil.translateVariables appears to not be able to find the correct converter in this context.
> A few other users have also noticed this issue and have commented on it here:
> http://www.nabble.com/Re:-TypeConverter-problems-p13545755s2369.html
> http://www.nabble.com/Struts-2-Multi-Level-Type-Conversion-t4802911.html
> http://www.nabble.com/-S2--Issue-with-Type-Conversion-and-Select-Boxes-t4864875.html
> http://www.opensubscriber.com/message/user@struts.apache.org/7986658.html
> http://permalink.gmane.org/gmane.comp.jakarta.struts.user/148485
> http://permalink.gmane.org/gmane.comp.jakarta.struts.user/148294
> http://permalink.gmane.org/gmane.comp.java.appfuse.user/28961
> http://www.roseindia.net/tutorialhelp/comment/25324

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