Something I am working on at the moment is a very simple utility that
generates a form bean from an XML definition. The goal is simply to reduce
typing in generating beans - as Roger mentioned, it is kinda tedious. I'm
using something like this to specify a bean:
<form-bean name="AddressForm" validate="true">
<property name="street"/>
<property name="city" allowEmpty="false"
errorMessage="error.city.required"/>
<property name="zip" allowEmpty="false" errorMessage="error.zip.required"/>
</form-bean>
Pretty simplistic stuff, but it meets my needs right now. If this would be
of interest to people (and if my company allows it), I can make it
available when I'm done.
Also, if people have ideas on what it might do differently, or what else it
might do, I'd be interested in hearing them. And if anyone has a copy of
the messages from Mark Wutka mentioned in the Struts 1.1 TODO list, I'd
appreciate it if they could forward them to me.
Thanks!
--
Martin Cooper
Tumbleweed Communications
At 10:12 AM 1/11/01 -0800, you wrote:
>Roger Kjensrud wrote:
>
> > Hello,
> >
> > I wonder if any of you have implemented an automatic way of populating the
> > properties in the ActionForm? It's kind of tedious to write all these
> setter
> > and getter methods....
> >
>
>For generating the code of a form bean automatically, that is something I want
>to look at in the 1.1 time frame. As well, we need to look at use cases where
>you do not know the property names ahead of time, and need them to work
>totally
>dynamically.
>
>For populating the properties, if you are trying to copy things from a
>"business
>logic" bean that has the same property names, consider the
>PropertyUtils.copyProperties() method.
>
> >
> > I found an
> > article(http://www.javaworld.com/javaworld/jw-12-2000/jw-1201-struts.html)
> > describing one way of doing this, and I would be interested in hearing some
> > feedback on doing it that way.
> >
> > Thanks,
> > Roger Kjensrud
>
>Craig McClanahan