commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bessie" <Timothy.Bes...@on24.com>
Subject Please disregard my last question (Was: RE: How to control conversion of primitives->String in BeanUtils.describe() ??)
Date Fri, 12 Jan 2007 05:26:40 GMT
Please disregard my question, below.
After banging my head against the wall enough times, I
found that the Converters weren't being registered.  They were
in an init() method that was being called from servlets and JSPs,
and that method (and the BeanUtils related classes) were all
being loaded by different class loaders each time.  I had neglected
to call the init() method ANY time it need to be used, but instead
was only calling it when a certain method in the same class was
used (which happened chronologically before the call to
BeanUtils.describe(),
but existing in a different class loader).

Ah well.  Live and learn.  Sorry to bug y'all!

- Tim Bessie

-----Original Message-----
From: Timothy Bessie [mailto:Timothy.Bessie@on24.com] 
Sent: Thursday, January 11, 2007 9:01 PM
To: commons-user@jakarta.apache.org
Subject: How to control conversion of primitives->String in
BeanUtils.describe() ??

Does anyone out there know how to control the conversion of primitives
to Strings in calls made to BeanUtils.describe()?

I have registered converters to the String class, as follows:

        ConvertUtils.register(toStringConverter, String.class);
        LocaleConvertUtils.register(toStringConverter, String.class,
Locale.US);
        LocaleConvertUtils.register(toStringConverter, String.class,
Locale.ENGLISH);

but they don't seem to ever get called.  Conversion to other classes
gets called (for example, I've registered a converter to the Date class,
which does get called).

Am I missing something here?  I have read through the documentation,
looked at the source, done a ton of Googling and looking in the mailing
list archives, and I can't find anything to help me with this.
Is there, then, no way to control the conversion of primitives to
Strings, or am I going about it the wrong way?

- Tim Bessie

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



---------------------------------------------------------------------
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