struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Abrams <>
Subject Values saving with brackets when setting values inside of lists of lists?
Date Thu, 04 Mar 2010 14:02:10 GMT
So I'm trying to save tables in struts.

I'm hitting a strange error when setting values of Lists of Lists, which
causes any value saved to be contained in brackets.  The params interceptor
doesn't log these brackets so its probably an error in the setting function
(OGNL?).  I couldn't find this behavior documented anywhere.  I know
Multi-dimensional arrays work fine (String[][] instead of
List<List<String>>).  Anyone know a workaround for lists of lists (example

Also, I couldn't find a way to make struts form tags work inside iterators.
 Does anyone know of a plugin or extension that supports this?  I have a
workaround, but its slower to duplicate the struts checkbox and multiselect
functionality by hand.


<form action="someAction">
<s:iterator value="listOfLists" status="rowStatus">
  <s:iterator status="columnStatus">
    <input type="text" name="listOfLists[<s:property
value="#rowStatus.index"/>][<s:property value="#columnStatus.index"/>]"

public class SomeAction {
   private List<List<String>> listOfLists;
   public List<List<String>> getListOfLists() {
      return table;
   public SomeAction() {
      if (listOfLists == null) {
         listOfLists = new ArrayList<List<String>>();
         for (int i = 0;i<10;i++) {
            listOfLists.add(new ArrayList<String>());
            for (int j = 0;j<10;j++)
               listOfLists.get(i).add("(" + i + "," + j + ")");

<bean id="someAction" class="SomeAction" scope="singleton"/>

<action name="someAction" class="someAction">

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message