commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell" <flame...@gmail.com>
Subject Re: Digester and using of java.util.Date
Date Thu, 02 Nov 2006 08:20:38 GMT
On 11/1/06, Zmitko, Jan <Jan.Zmitko@dresdner-bank.com> wrote:
> Hi,
>
> I´ve a question why it´s not possible to use "java.util.Date" in
> digester respectively in the digester rule file. Instead the type
> "java.sql.Date" works.

This was a fun one :)

> Can someone explain me what´s the reason?

Under the hood, Digester uses BeanUtils to do its converting. If you
look at ConvertUtilsBean
[http://svn.apache.org/repos/asf/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java]
and search for Date, you'll see that by default BeanUtils does not
register a converter for java.util.Date.

The other direction was resolved in BeanUtils a little while ago:
http://issues.apache.org/jira/browse/BEANUTILS-239 but that's for
Date->String.

I've raised an issue for converting in this direction:
http://issues.apache.org/jira/browse/BEANUTILS-255.

If it's not something you can work around, you could write a
UtilDateConverter of your own and register it with ConvertUtils for
java.util.Date (and submit to BEANUTILS-255? :) ); or follow
BEANUTILS-255 and one should hopefully be added soon. BeanUtils has
been pretty inactive, but a few of us have started digging into its
backlog of issues recently.

Hen

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message