You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Josh Mabry (JIRA)" <ji...@apache.org> on 2014/08/27 20:41:57 UTC
[jira] [Commented] (WW-4398) Parameters mapping to java.util.Set of
complex type doesn't work
[ https://issues.apache.org/jira/browse/WW-4398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14112621#comment-14112621 ]
Josh Mabry commented on WW-4398:
--------------------------------
Steps to reproduce:
Place the following 2 member variables on an Action with appropriate Getters/Setters:
private Set<MyInner> myInnerSet; //MyInner is defined below
private Set<Integer> myIntegerSet;
Add these tags to your JSP to show off:
<s:hidden name="myInnerSet.idString" value="1"/>
<s:hidden name="myInnerSet.idString" value="2"/>
<s:hidden name="myIntegerSet" value="1"/>
<s:hidden name="myIntegerSet" value="2"/>
Execute Action and see what was mapped onto you Action's member variables.
Expected results:
myInnerSet.size() == 2
myIntegerSet.size() == 2
Actual results:
myInnerSet.size() == 0
myIntegerSet.size() == 2
public class MyInner {
private String idString = null;
public String getIdString() {
return idString;
}
public void setIdString(String idString) {
this.idString = idString;
}
}
> Parameters mapping to java.util.Set of complex type doesn't work
> ----------------------------------------------------------------
>
> Key: WW-4398
> URL: https://issues.apache.org/jira/browse/WW-4398
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.3.16.3
> Reporter: Josh Mabry
>
> When you have a java.util.Set of complex objects, the ParametersInterceptor can not map those values onto the set. A Set of complex objects is easily defined as a Set<MyTestClass> where MyTestClass has a String idString as its only property.
--
This message was sent by Atlassian JIRA
(v6.2#6252)