You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Duffey, Kevin" <KD...@BUYMEDIA.com> on 2000/09/21 01:32:24 UTC

Auto-population of non ActionForm beans?

Hey Craig,

Have you added support yet for that little problem I was having..so that
instead of a bean redoing the same get/set methods as my entity bean, I can
just pass through directly to the entity bean? That way we don't have to
implement ActionForm, we can just have any old class be used by the
auto-population feature?

Thanks.

Re: Auto-population of non ActionForm beans?

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
"Duffey, Kevin" wrote:

> Hey Craig,
>
> Have you added support yet for that little problem I was having..so that
> instead of a bean redoing the same get/set methods as my entity bean, I can
> just pass through directly to the entity bean? That way we don't have to
> implement ActionForm, we can just have any old class be used by the
> auto-population feature?
>
> Thanks.

BeanUtils.populate() can do this for you -- either from a Hashtable of values
or directly from an HttpServletRequest.  This is what the Struts controller
servlet uses to do the auto-populate trick, so you'll end up with the sames
results if our entity bean has the same properties.

Craig McClanahan

====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat