You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Reumann <ma...@reumann.net> on 2002/10/16 03:15:44 UTC

question about using ConvertUtils

Craig,

I'm still having a bit of trouble trying to use BeanUtils to copy
java.util.Date properties. It appears that it will work fine by
default with java.sql.Date but isn't set up by default for
java.util.Date (which I'm using for Dates in my business bean). I
build a class implements Converter interface and used the ConvertUtils
to register java.util.Date with this Converter. It works great
converting the String form properties to Dates as expected. The
question I have is how do I build a converter (or modify the existing
one) that will convert the Date properties to String properties when I
want to go the other way with the copyProperties (populate my DynaForm
from a business bean)? I tried modifying the covert method of the
Converter I created so that if the arg was a String property it would
covert and return a Date but the problem is this Converter never got
used when going the other direction (Date to String). Any ideas what
I'm doing wrong or what I can do to solve this problem?

Thanks lots

-- 

Rick
mailto:maillist@reumann.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>