• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IllegalArgumentException

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
luks like Problem is in setting arrayList object from hidden field to setter in bean.

please help.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic