On Friday, October 11, 2002, 2:02:11 PM, Craig wrote:
CRM> * Form bean property is a String.
<SNIP>
CRM> * Value/DTO objects would use the native data types
CRM> (java.util.Date in this case). Property name would
CRM> be the same "birthDate".
<SNIP>
CRM> * Either use a copyProperties method or write a custom
CRM> helper method to copy all the individual properties.
<SNIP>
Thanks Craig. It seems like if you do like above (using the
String birthDate in the form bean, and the native Date
'birthDate' in the model bean, then you don't get the benefit of
using the BeanUtils.copyProperties() method? I must be messing
something up because BeanUtils.copyProperties() seems to crap
out on me if I have native java.util.Date birthDate and form
bean property birthDate. Even if I want to use a helper method
to do the conversion, it seems like I have to throw out the
BeanUtils.copyProperties() if I want to have a form bean String
and java.util.Date with the same field name? What I'd like to
be able to do is using the copyProperties() of BeanUtils to copy
over all the Strings in the form bean to the String (or ints) in
the value object and then use a helper to deal with the Strings
that need to be converted to Dates. The problem I'm running into
is it seems to be an 'either' 'or' deal. Either, I make sure
their is a Date as a String also in my model bean or else I use
helper class to convert everything and not use the
BeanUtils/PropertyUtils. Is there a way around this? (besides
doing what I've done and have two versions of the date object in
the value object... one as a String and one as a java.util.Date)
?
Thanks again
--
Rick
mailto:[EMAIL PROTECTED]
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>