wood burning stoves 2.0*
The moose likes Struts and the fly likes IllegalArgumentException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "IllegalArgumentException" Watch "IllegalArgumentException" New topic
Author

IllegalArgumentException

Ravi Gupt
Greenhorn

Joined: Oct 16, 2007
Posts: 17
Hi,

I wrote a formBean which has getter setter for an arrayList.
my getter is:


public Collection getLdapVOList() {
// return arrayList object
}

setter is:

public void setLdapVOList(Collection ldapVOList){
this.ldapVOList =(ArrayList) ldapVOList;
}


in JSP:

im setting this arraylist as hidden value.

<input type="hidden" name="ldapVOList" value="<c ut value="${userValidationServerForm.ldapVOList}"/>">


and while submitting the form I am getting this exception:


java.lang.IllegalArgumentException: Cannot invoke com.intruvert.ui.struts.configure.admin.nac.userValidationServer.UserValidationServerForm.setLdapVOList - argument type mismatch
at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1778)
at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759)
at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648)
at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677)
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022)

much more......
Ravi Gupt
Greenhorn

Joined: Oct 16, 2007
Posts: 17
luks like Problem is in setting arrayList object from hidden field to setter in bean.

please help.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
guptaravi,

Please check your private messages for an important message from me. You can do so by clicking My Private Messages on the upper right part of this page.
[ October 16, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
You cannot store an entire collection as a single hidden field on a form. I can remember in one case where I had to store a list of id values in a hidden field. I created methods like "String getIdListAsString()" and "void setIdListAsString(String list)". I then had code to create a delimited string from the list of IDs (like "34,48,238") and code to parse the string and create a list. You might be able to use the approach if your Collection just holds simple types.

- Brent
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

"Ravi G"

Your name still does not conform to the JavaRanch Naming Policy. Please review the policy and update it appropriately. This is your second warning.

Scott Selikoff


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IllegalArgumentException