The other problem on form population is that if an alphanumeric string (form
user input) is assigned to the int or long form property. Since the string
is an invalid number, the convertUtils will covert the data to 0 which is
incorrect.
Since the form population occur before the form validation, we lost the
information for incorrect user input. So I think there has to be some sort
of validation before the form population. Otherwise the user of form bean is
pretty limited.
This validation is more important if nested property is used to set the
property of a business object inside the form bean. Since the set method on
the business object may already contain the validation, an exception may be
thrown (from the set method of the business object) in the form population.
Is there any plan to enchance the form population in the future struts
release?
-----Original Message-----
From: Jim Richards [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 5:33 PM
To: [EMAIL PROTECTED]
Subject: Re: Form population
I'm pretty sure it was all as expected. Although I find it
interesting that it works with "int" rather then "Integer",
from what I saw of the code.
I've changed it all the String and it works now, but I was
poking around in BeanUtils and PropertyUtils and so on (don't have
the reference here) and it seems that for nested properties
it only handles a String (haven't fully checked it yet).
"Natra, Uday" wrote:
>
> yeah that was a good point from Dmitri. I tried to define two setter
methods
> for my date field. one is a String argument and the other one is a date
> argument. When I ran the App, it complained about not able to find the
> setter method. So may be there is some thing like that happening in ur
code.
>
> Thanks,
> Uday.