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.
-----Original Message-----
From: Dmitri Plotnikov [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 9:59 AM
To: [EMAIL PROTECTED]
Subject: Re: Form population
Just an idea...
Struts uses JavaBeans Introspector to discover
properties of beans. Introspector is pretty picky in
the way it decides whether something is a property or
not. Specifically, it requires that
1) Both getter and setter be declared public and
non-static
2) The return type of the getter be the same as the
type of the argument of the setter.
Check if your property breaks one of these rules.
- Dmitri Plotnikov
"Natra, Uday" wrote:
Hi,
It is a <html:text.. /> field and I use int not
Integer.
Thanks,
Uday.
-----Original Message-----
From: Jim Richards [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 15, 2001 8:59 PM
To: [EMAIL PROTECTED]
Subject: RE: Form population
What sort of field on the form is it (not that it
should matter)? a
<html:text> or something
else. And is it a "Integer" or "int" for the setter?
I'm using it as a nested property as well, so the
jsp looks like
<html:text property="user.key" size="20"
maxlength="80"/>
But I couldn't see anything in the code that would
cause a problem with
this.
At 11:36 AM 15/04/01 -0500, you wrote:
>It does work for me. I use a setter method with an
integer argument in my
>FormBean and FormBean invokes that method to change
the data.
>
>Thanks,
>Uday.
>
>-----Original Message-----
>From: Jim Richards [mailto:[EMAIL PROTECTED]]
>Sent: Sunday, April 15, 2001 2:28 AM
>To: [EMAIL PROTECTED]
>Subject: Form population
>
>
>
>I've been having a dig around, and have found that
the BeanUtils.populate
>doesn't really
>handle very many datatypes. Or more specifically, I
can't get it to set an
>integer value,
>where my bean has
>
> public void setKey(int key);
>
>or
>
> public void setKey(Integer key);
>
>neither get called. What I am finding is the
BeanUtils only finds String
>values when it
>process the results of the form, and so thinks all
the setter methods are
>Strings
>as well. There doesn't seem anyway to force the
<html:text/> tag to be an
>Integer
>value. I can understand why the first won't work
(non-object type), but not
>the second.
>
>Any suggestions, or this is a feature/bug?
>
>
>--
>Kumera - a new Open Source Content Management
System
>for small to medium web sites written in Perl and
using XML
>http://www.cyber4.org/kumera/index.html
>
--
Kumera - a new Open Source Content Management System
for small to medium web sites written in Perl and
using XML
http://www.cyber4.org/kumera/index.html
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/