commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romualdo Rubens de Freitas" <romuald...@gmail.com>
Subject $$$ [Digester] Converting String do java.util.Date $$$
Date Fri, 19 Oct 2007 19:14:14 GMT
Hi All,

I'm facing a problem with date conversion. My XML document has an element whose
value has the format dd/MM/yyyy (brazilian date format). When Digester
tries to convert
the value to a date I get an exception stating:
<code>
19/10/2007 16:05:31
org.apache.commons.beanutils.converters.DateTimeConverter toDate
WARNING:     DateConverter does not support default String to 'Date' conversion.
19/10/2007 16:05:32
org.apache.commons.beanutils.converters.DateTimeConverter toDate
WARNING:     (N.B. Re-configure Converter or use alternative implementation)
19/10/2007 16:05:32 org.apache.commons.digester.Digester endElement
SEVERE: End event threw exception
org.apache.commons.beanutils.ConversionException: DateConverter does
not support default String to 'Date' conversion.
</code>

In the middle of the msgs above there is one that called my attention:
N.B. Re-configure Converter or use alternative implementation

According BeanUtils docs I can do that, but I didn't find any
information on how to do that
with Digester.

Debugging Digester source code I've found
DateTimeConverter.convertToType() method
that has the following "if (useLocaleFormat) ..." which, I guess,
could do the job, but I
don't know how to setup locale info so that the conversion can be done.

Besides that, I could use Calendar, but I don't know how to use it, too.

Any help (with Date conversions and Calendar types) would be appreciated.

TIA.

-- 
Romualdo Rubens de Freitas

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


Mime
View raw message