Michael McGrady wrote the following on 9/16/2004 3:18 PM:
SECOND BeanUtils
I would have BeanUtils populate a List and then have the logic in the form populate the Object FooBar. That is, I would do the same thing in populating the FooBar class as mining, retrieving, etc. that class. Just use a list or other standard container for the BeanUtils operations.
Make sense?
Actually no:) I'm pretty lost now. Using the Session seems so much easier:)
If you bored you can try to show me what you would change to get the following example to work (Ill use UserForm for the Struts stuff and FooBar for the non-struts class):
class UserForm extends ActionForm { private FooBar fooBar; //setFooBar(FooBar foobBar) //getFooBar(); }
class FooBar { private String name; private Collection fooBars; //set/gets }
//In SetUp of an Action
//business logic called that returns a FooBar object, but for this
//test just create a FooBar object and add a Collection of 2 FooBars to
//each Collection. 2 deep is fine. Add to form... userForm.setFooBar(fooBar);
//forward to JSP form....
//on JSP form (I'll end up with tags to do this etc) but for now..
<nested:text property="fooBar.name"/> <nested:iterate property="fooBar.fooBars"> <nested:text property="name"/> <nested:iterate property="fooBars"> <nested:text property="name"/> </nested:iterate> </nested:iterate>
I think I need more of a concrete example of what you'd change to make this work. What I think would work is wrapping the FooBar object in UserForm inside of a FooBarWrapper. Haven't figured out exactly how I'd implement it but you and Niall have given me some ideas.
-- Rick
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]