I downloaded the lastest build of Struts to make my changes to the files
there. I have only changes the classes BeanUtils and PropertyUtils, which I
then realized have been move to the commons project, the reason I also send
this mail to the commons mailing list.

In addition to the changes, I have also created two new classes which I have
moved to the org.apache.commons.beanutils package.

In the attached file there is the two changed classes, and the two new
classes, plus a small demo struts app with three jsp's and a single action
form (of course with dynamic properties).

I have create an interface beans with dynamic properties must implement,
there is one method that returns a DynamicPropertyDescriptor (subclass of
PropertyDescriptor) given a property name (null if the name isn't a dynamic
property).

In PropertyUtils I changed the getSimpleProperty and setSimpleProperty check
if the property is dynamic and then call getDynamicProperty or
setDynamicProperty.

In BeanUtils i have changed the getPropertyDescriptor to return
DynamicPropertyDescriptor in case of a dynamic property.

With these changes is Struts works fine with dynamic properties. I have not
tested with indexed and nested properties, but believe I would work.

Regards,
Jan Sorensen
aragost


--- Oleg V Alexeev <[EMAIL PROTECTED]> wrote:
> Hello Jan,
>
> I am interesting in it. Please, post it directly to
> list or place it
> somewhere in public domain and post here URL to it.
>
> Thursday, August 16, 2001, 7:19:23 PM, you wrote:
>
> JS> Hello list, Craig
>
> JS> I have more or less implemented ActionForms With
> Dynamic Properties as
> JS> mentioned in the ToDo list. I would be happy to
> contribute the code to
> JS> Struts.
>
> JS> A quick description of what I have done: A
> dynamic action form implements a
> JS> method to return a PropertyDescriptor for each
> dynamic property. I have
> JS> changed the methods PropertyUtils.getProperty()
> and
> JS> PropertyUtils.setProperty() to work with dynamic
> properties. Now when a form
> JS> is submitted the dynamic properties of the
> action form will be populated
> JS> through the setProperty() method. The dynamic
> property values will also be
> JS> displayed in the JSP assuming the tags uses
> PropertyUtils.getProperty()
> JS> method to obtain the property value.
>
> JS> Please let me know if you are interested in the
> code, and how to proceed
> JS> from here.
>
> JS> Regards,
> JS> Jan Sorensen
> JS> aragost
>
>
>
>
> --
> Best regards,
>  Oleg
> mailto:[EMAIL PROTECTED]
>
>


DynamicProperties.zip

Reply via email to