I think so -- whichever setter method within your ActionForm applies to the
field named in your <html:select> tag has to be the ONLY setter method named
whatever it's named.

That's contradictory to normal bean conventions where you would normally
have

public void setValues(Vector values)
and
public void setValues(String key, String value)

for instance.  The introspection done by Struts can't tell the difference so
you get an error thrown by BeanUtils.populate where it tries to call
setValues(String key, String value) with only one value.

There has been a fair amount of debate about this recently, but if you have
overloaded setter methods, comment all but the one that suits the type of
value you're really using, and see if it works.

I had to go from having
public void setIds(String ids[])
and
public void setIds(int i; String ids[])

to having

public void setIds(String ids[])
and
public void setId(int i; String ids[])

see the difference?  The "s" is gone in the case of the indexed property.

See if that applies to your situation.

----- Original Message -----
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 10:56 PM
Subject: Re: Help with optionsCollection error


> I'm currently implementing the recipients as a vector of beans and I do
> provide method setRecipients which takes in a vector and sets the
> recipients vector to it. Is that the setter method you are referring to ?
> Thanks.
>
>
>
>
> Ian Hunter wrote:
> > The ActionForm descendant.
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to