File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "IllegalArgumentException" Watch "IllegalArgumentException" New topic


Ravi Gupt

Joined: Oct 16, 2007
Posts: 17

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(
at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(
at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(
at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(

much more......
Ravi Gupt

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

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 ]

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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3753

"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

[OCA 8 Book] [Blog]
I agree. Here's the link:
subject: IllegalArgumentException
It's not a secret anymore!