Link to home
Start Free TrialLog in
Avatar of hmeh
hmeh

asked on

Struts html:select java.lang.IllegalArgumentException argument type mismatch

Hi,
I am trying to submit a list of 'CustomerDetailsDTO' bean comprising attributes ie. name, address in 'CustomerDetailsForm' using the following code. My form CustomerDetailsForm.getListCustomerDetails() method returns me the list of POJOs of CustomerDetails dto

<html:select name="CustomerDetailsForm" property="listCustomerDetails" onchange="submit()"> <bean:define name="CustomerDetailsForm" property="listCustomerDetails" id="list2" /> <!-- html:optionsCollection value="address" label="address" name="CustomerDetailsForm" property="listCustomerDetails"/--> <html:options collection="list2" property="address" /> </html:select>

Everything goes fine and the page gets loaded but when i click on submit it gives me the exception.
java.lang.IllegalArgumentException: Cannot invoke forms.CustomerDetailsForm.setListCustomerDetails - argument type mismatch at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1778) at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759)
I experimented the similar thing but there it was String[] as form field. In the above code i need to iterate through the pojo objects stored as elements in list.
I w'ld appreciate if somebody can help.
Thanks in advance
Hh m
ASKER CERTIFIED SOLUTION
Avatar of hmeh
hmeh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial