struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Mabry (JIRA)" <>
Subject [jira] [Commented] (WW-4398) Parameters mapping to java.util.Set of complex type doesn't work
Date Wed, 27 Aug 2014 18:41:57 GMT


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:
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions:
>            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

View raw message