commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Bowen <>
Subject BeanUtils copProperties with Struts and Torque?
Date Tue, 17 Aug 2004 12:28:10 GMT
Hello. I am using Torque to generate the persistent
classes for my web application. Torque generates these
classes based on an xml file, in which you specify the
table name, column name and column type.

What I would like to do is use copyProperties() to
copy from an ActionForm directly to my
Torque-generated beans but of course, everything is a
String in the ActionForm world, whereas in my
persistence classes my date fields, for example, are
Dates, not Strings, so copyProperties fails.

I have been looking all over the jakarta web site, the
archives of this mailing list, etc. People seem to be
talking about creating a bean that acts as a
go-between, a DTO I suppose, that has the same fields,
getters and setters as the ActionForm, and that you
first copy the properties to the DTO. 

But ... won't I have the same problem when trying to
use copyProperties? Do I have to somehow use the
ConvertUtils instead?

Any help much appreciated. I am using a single servlet
to instantiate a bean of type 'x', copy the values
from a form and save it in the database, so having to
type 'gets' and 'sets' for every possible case ... is
a waste of time, bad design, etc.

Many thanks!

Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!

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

View raw message