You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Jasper Rosenberg (JIRA)" <ji...@apache.org> on 2007/07/18 14:56:11 UTC
[jira] Created: (WW-2046) Radio map to map type conversion now
fails
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
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.
[jira] Commented: (WW-2046) Radio map to map type conversion now
fails
Posted by "Jasper Rosenberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42263 ]
Jasper Rosenberg commented on WW-2046:
--------------------------------------
Sorry I've been MIA on this issue. I haven't had any time to try re-upgrading after having to back out 2.0.8, but I will be sure to let you know how it works out as soon as I get the opportunity.
> 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
> Assignee: Don Brown
> Fix For: 2.0.12
>
>
> 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.
[jira] Updated: (WW-2046) Radio map to map type conversion now
fails
Posted by "James Holmes (JIRA)" <ji...@apache.org>.
[ 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: 2.0.11)
2.0.12
> 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
> Assignee: Don Brown
> Fix For: 2.0.12
>
>
> 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.
[jira] Commented: (WW-2046) Radio map to map type conversion now
fails
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42110 ]
Don Brown commented on WW-2046:
-------------------------------
Would it be possible to write up a test for this? I can understand the key in the map being converted to a string (all keys are converted to strings for comparison), but I don't see where the string array comes from. In your example, wouldn't the value be the string "A"?
> 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.
[jira] Updated: (WW-2046) Radio map to map type conversion now
fails
Posted by "James Holmes (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Commented: (WW-2046) Radio map to map type conversion now
fails
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42260 ]
Don Brown commented on WW-2046:
-------------------------------
Try a later version like 2.0.11 and let us know if it is still a problem.
> 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
> Assignee: Don Brown
> Fix For: 2.0.12
>
>
> 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.
[jira] Updated: (WW-2046) Radio map to map type conversion now
fails
Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ted Husted updated WW-2046:
---------------------------
Fix Version/s: Future
Setting Fix Version to "future" for issues without a set fix version.
> 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: Future
>
>
> 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.
[jira] Resolved: (WW-2046) Radio map to map type conversion now
fails
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Don Brown resolved WW-2046.
---------------------------
Resolution: Fixed
I wrote a test that proved, using your example, that Struts properly handles a map of strings. Please reopen if it is still a problem.
> 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: Plugin - Tags
> Affects Versions: 2.0.8
> Environment: freemarker
> Reporter: Jasper Rosenberg
> Assignee: Don Brown
> Fix For: 2.1.3
>
>
> 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.
[jira] Assigned: (WW-2046) Radio map to map type conversion now
fails
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Don Brown reassigned WW-2046:
-----------------------------
Assignee: Don Brown
> 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
> Assignee: Don Brown
> 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.