commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Bowen <>
Subject Whoops. Let's try that again -- copyProperties smart enough to copy to sub-objects?
Date Wed, 18 Aug 2004 12:28:48 GMT
Many thanks to those who responded to my post
yesterday (Craig McClanahan, Marco Mistroni), I think
I am up and running with BeanUtils.copyProperties().

I had another question though, one I am almost sure to
which the answer will be "no".

Given the following -- An object, OuterObject, which
represents table1 in the database, and a getter() and
setter() in OuterObject for InnerObject (another
table), like this:

class OuterObject {

 private String ooField1;
 private InnerObject obj2;

 public void setOOField1(String ooField1);
 public String getOOField1();

 public void setInnerObject(InnerObject io);
 public InnerObject getInnerObject();


class InnerObject {

 private String iofield1;

 public void setIOField1(String ioField1);
 public String getIOField1();


... and an ActionForm with 2 fields, ooField1 and
The question: when I submit this form and call
copyProperties, is there a way to tell it to copy
iofield1 to the InnerObject? In other words, to call

... Seems complicated. But I have a bunch of
ActionsForms which encapsulate more than 1 Java class
/ database table, and I hope I don't have to do all
that copying by hand!

Many thanx in advance!

Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message