On Wednesday, October 16, 2002, 7:06:45 PM, Elderclei R Reami wrote:
ERR> That's why I include the horrible if statement in
ERR> StringConverterDateDecorator.
ERR> if (type==String.class && value.getClass()==Date.class)
ERR> {
ERR> /* do conversion */
ERR> }
ERR> else
ERR> {
ERR> /* stringConverter is an instance of the
ERR>
org.apache.commons.beanutils.converters.StringConverter */
ERR> returnValue = stringConverter.convert(type, value);
ERR> }
Cool, Thanks! Now I'm excited to work with this tomorrow...I
wasn't calling
returnValue = stringConverter.convert(type, value);
Actually you know what might be a decent idea: modifying the
StringCoverter code to deal with the correct format for how you
want to convert java.util.Dates to Strings. Might provide a
default SimpleDateFormat and then also include a type of register
method that could take a String pattern for how you want to
format the Dates to Strings in order to over-ride the default.
I'll work on it tomorrow and let you know how it turns out. At
least this way you'll only have to register a DateConverter and
not another Converter to deal with Dates to Strings.
Thanks again.
--
Rick
mailto:[EMAIL PROTECTED]
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>