On Mon, 23 Dec 2002 11:49:04 -0500
Jim Krygowski <[EMAIL PROTECTED]> wrote:
> This is my test:
> ...
> String input = null;
>
> // check to make sure the datatype is right
> input = "2002-03-17";
> Date dateValue = (Date)ConvertUtils.convert(input, Date.class);
> assertTrue(dateValue instanceof Date);
But where is this dateValue being used? You saying it's not converting
java.util.Date to a String properly for you yet I don't see this Date
being used anywhere to even allow it be converted to the String in the
correct format.
>
> // try to get a value from a Map
> HashMap values = new HashMap();
> values.put("today", "2002-03-17");
> MockForm mockForm = new MockForm();
> BeanUtils.copyProperties(mockForm, values);
Isn't your concern going the other direction that is having you
stumped? In other words here you are just doing a String to String
conversion. Why don't you create a Bean that has java.util.Date field
and then do
BeanUtils.copyProperties(mockForm, theObjectThatHasAdateField );
Then try
> Map beanProps = BeanUtils.describe(mockForm);
> System.out.println(beanProps.get("today"));
--
Rick
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>