You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Phase Communcations <ma...@phase.ws> on 2002/01/18 22:14:05 UTC
This is cool. DynaBeans!!
Something to look forward to :-)
Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
mail@phase.ws
http://www.phase.ws
-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org]
Sent: Wednesday, January 16, 2002 12:22 PM
To: Struts Developers List
Subject: Re: DynaBean examples?
On Wed, 16 Jan 2002, Will Jaynes wrote:
> Date: Wed, 16 Jan 2002 11:37:15 -0500
> From: Will Jaynes <ja...@umich.edu>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: struts-dev@jakarta.apache.org
> Subject: DynaBean examples?
>
> Does someone have any code demonstrating the use of the DynaBean stuff?
> I'm sure I want to use it, but I need a little kick-start.
>
One place to start would be to look at the unit test programs in the
commons-beanutils nightly source bundle. But, fundamentally, it's not
totally different from how yo access properties using PropertyUtils, where
you might say:
MyBean bean = ...;
String name = PropertyUtils.getSimpleProperty(bean, "name");
you would instead say
MyBean bean = ...; // Must implement DynaBean
String name = bean.get("name");
One very nice feature is that PropertyUtils has been enhanced to
understand DynaBeans internally, so you can actually use *either* syntax
in your application. That way, all the Struts tags that already use
PropertyUtils will be able to auto-magically work with DynaBeans as well.
Look for a check-in of DynaActionForm (so that you can define the
properties of form beans without having to create a Java clas for every
one) real soon now ...
> Will
>
Craig
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>