What does a setter for values from <SELECT/> look like?

[email protected]
Newsgroups gmane.comp.web.maverick.general
Message-ID <[email protected]>
I am using ThrowawayBean2 as the base class of my controllers, with the "model
as controller" style. When there are HTML form parameters in the request, these
get automatically transferred to fields in my controller/model objects,
providing that I write an appropriate setter method.

This has worked fine for text controls, checkboxes, radio buttons etc., but I
can't work out how to do <SELECT>. If my setter accepts a String or a String[]
array, it does not get called. If my setter accepts some type of Collection,
Maverick throws an IllegalArgumentException in the Apache BeanUtils. Some of the
stack trace is given below:

14:21:34.144 WARN!! Exception for /alarmlog.m
java.lang.IllegalArgumentException: argument type mismatch
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

     at java.lang.reflect.Method.invoke(Method.java:324)
     at
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1386)

     at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1298)

     at
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1327)
     at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:562)
     at org.infohazard.maverick.ctl.ThrowawayBean2.go(ThrowawayBean2.java:39)
     at org.infohazard.maverick.ctl.Throwaway2.go(Throwaway2.java:48)

The above problem seems to be equally true whether or not the <SELECT> has
MULTIPLE set.

I presume that I am doing something wrong, but if so, what?

Where would I find documentation of what signature should be used for the setter
for data from each possible type of HTML control?

#:^P




-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
[INVALID FOOTER]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.