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 2007/08/17 17:54:35 UTC

[jira] Updated: (WW-2046) Radio map to map type conversion now fails

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

James Holmes updated WW-2046:
-----------------------------

    Fix Version/s:     (was: Future)
                   2.0.11

> Radio map to map type conversion now fails
> ------------------------------------------
>
>                 Key: WW-2046
>                 URL: https://issues.apache.org/struts/browse/WW-2046
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: 2.0.8
>         Environment: freemarker
>            Reporter: Jasper Rosenberg
>             Fix For: 2.0.11
>
>
> Example:
> Action has get/set for: 
> private Map<String, String> myMap = new HashMap<String, String>();
> Template:
> <@s.radio name="myMap['name']" list='#@java.util.HashMap@{"Opt.":"Opt.", "Std.":"Std.", "":"N/A"}' theme="simple"/>
> In struts 2.0.6, when I selected a value in the radio button, it would correctly create a map from String to String.
> In struts 2.0.8, when I selected a value in the radio button (any of the three), it would incorrectly create a map from String to String[].
> Not sure if this is due to a change in 2.0.8, or in XWork 2.0.3.
> I have a second case that again used to work in 2.0.6, that now fails in 2.0.8 where the map key is also not converting correctly:
> public class ReviewPicturesAction ... {
>     /** New picture status approve. */
>     public static final String APPROVE = "A";
>     /** New picture status deny. */
>     public static final String DENY = "D";
>     /** New picture status prefer. */
>     public static final String PREFER = "P";
>     private Map<Long, String> pictureMap = new HashMap<Long, String>(); 
>    
>     // getter/setter
>     ...
> }
> <@s.set name="statusMap" value="#@java.util.LinkedHashMap@{@com.myco.action.ReviewPicturesAction@APPROVE:'A',@com.myco.action.ReviewPicturesAction@PREFER:'P',@com.myco.action.ReviewPicturesAction@DENY:'D'}"/> 
> <@s.radio name="pictureMap[5]" list="statusMap" theme="simple" value='@com.myco.action.ReviewPicturesAction@APPROVE'/>
> In this case the key in the map ends up as "62051" (String) rather than 62051L (Long), and the value is again a String[].

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