(Not commenting inline)
Remember though the problem is that BeanUtils is going to try to populate an new Object FooBar (that has nulls for it's inner Collections) with the html request params. Could you post what you are doing in your ActionForm reset() method? I don't see it listed below. I saw a class Reset but not sure what's that's all about.
Michael McGrady wrote the following on 9/16/2004 1:38 PM:
Rick
You can get the following FooBar output in [ActionForm].reset() in request scope with the code that follows the result;
fooBarMajorDomo 1fooBar 11fooBar 111fooBar 112fooBar 113fooBar 114fooBar 115fooBar 12fooBar 121fooBar 122fooBar 123fooBar 124fooBar 125fooBar 13fooBar 131fooBar 132fooBar 133fooBar 134fooBar 135fooBar 2fooBar 21fooBar 211fooBar 212fooBar 213fooBar 214fooBar 215fooBar 22fooBar 221fooBar 222fooBar 223fooBar 224fooBar 225fooBar 23fooBar 231fooBar 232fooBar 233fooBar 234fooBar 235fooBar 3fooBar 31fooBar 311fooBar 312fooBar 313fooBar 314fooBar 315fooBar 32fooBar 321fooBar 322fooBar 323fooBar 324fooBar 325fooBar 33fooBar 331fooBar 332fooBar 333fooBar 334fooBar 335fooBar 4fooBar 41fooBar 411fooBar 412fooBar 413fooBar 414fooBar 415fooBar 42fooBar 421fooBar 422fooBar 423fooBar 424fooBar 425fooBar 43fooBar 431fooBar 432fooBar 433fooBar 434fooBar 435fooBar 5fooBar 51fooBar 511fooBar 512fooBar 513fooBar 514fooBar 515fooBar 52fooBar 521fooBar 522fooBar 523fooBar 524fooBar 525fooBar 53fooBar 531fooBar 532fooBar 533fooBar 534fooBar 535fooBar 6fooBar 61fooBar 611fooBar 612fooBar 613fooBar 614fooBar 615fooBar 62fooBar 621fooBar 622fooBar 623fooBar 624fooBar 625fooBar 63fooBar 631fooBar 632fooBar 633fooBar 634fooBar 635fooBar
package com.crackwillow.testing;
import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.ListIterator;
public class Driver { public static void main(String [] params) { String fooBarName = "fooBar"; FooBar fooBar = new FooBar();
fooBar.setName(fooBarName + "MajorDomo");
FooBar iBar = null; FooBar jBar = null; FooBar kBar = null;
Collection iCollection = new LinkedList(); for(int i = 1; i < 7; i++) { iBar = new FooBar(); iBar.setName("" + i + fooBarName); iCollection.add(iBar); Collection jCollection = new LinkedList(); for(int j = 1; j < 4; j++) { jBar = new FooBar(); jBar.setName("" + i + j + fooBarName); jCollection.add(jBar); Collection kCollection = new LinkedList(); for(int k = 1; k < 6; k++) { kBar = new FooBar(); kBar.setName("" + i + j + k + fooBarName); kCollection.add(kBar); } jBar.setCollection(kCollection); } iBar.setCollection(jCollection); } fooBar.setCollection(iCollection);
new Reset().logic(fooBar); System.exit(0); } }
class FooBar { private String name; private Collection collection;
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public Collection getCollection() { return collection; }
public void setCollection(Collection collection) { this.collection = collection; } }
class Reset {
public void logic(FooBar outsideFooBar) { FooBar insideFooBar;
// A. Wrap non-collection name values into an appropriate list; System.out.println(outsideFooBar.getName());
// B. Use this logic to repeat the above recursively. Collection collection;
if((collection = outsideFooBar.getCollection()) != null) { Iterator iter = ((LinkedList)collection).listIterator(); while(iter.hasNext()) { insideFooBar = (FooBar)iter.next(); logic(insideFooBar); } } } }
Hope I am not becoming a pest but I thought this might be helpful.
Michael
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Rick
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]