Well, I understand the way HTTP is working there, it just SEEMS to be
that having the additional method (setBar(int, String)) confused
BeanUtils or something - because removing those methods (making no
other changes) cleared the problem up.
w
On Mon, 24 Jan 2005 17:15:01 -0500
Jeff Beal <[EMAIL PROTECTED]> wrote:
It's related to a difference in how the HTTP request parameters are
built. With the "indexed properties" that you had, the BeanUtils
classes are going to look for parameters whose names include the
index. That is 'bar[1]', 'bar[2]', etc.
HTML:select with multiple=true sends multiple parameters, all with
the name of 'bar'. So, instead of 'bar[1]=1&bar[2]=2' the HTTP
request will just be 'bar=1&bar=2'. The Java Servlet API exposes
these multiple requests with the same name as a String[], or the
first one as a single String.
The only time the Struts ActionForm framework is going to call an
ActionForm setter 'setBar(int index, String value)' is if the request
includes parameters named as in the first example. It will call the
setter 'setBar(String[] values)' if it sees multiple values for the
same parameter.
-- Jeff
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]