File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Trouble with indexed properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Trouble with indexed properties" Watch "Trouble with indexed properties" New topic

Trouble with indexed properties

Martin Riedl

Joined: Sep 06, 2003
Posts: 7
i know that this topic has been discussed earlier and i already have one version of indexed properties on another jsp that runs - but this time i have serious trouble.
I have an ActionForm-Bean which contains a String-Array of Beans.
private ListBean[] beans;
private ListBean bean;
public ListBean[] getBeans()
return beans;
public void setBeans(int index, ListBean bean)
beans[index] = bean;
public void setBean(int index, ListBean value)
beans[index] = value;
public ListBean getBean(int index)
return (ListBean) beans[index];
--Code end
This code in my jsp look like:
<html:form action="" >
<table width="400" border="0" >
<logic:iterate id="speech"
type="" >
<td width="20%">
<html:checkbox property='<%= "beans[" + ctr + "].copy" %>' />
<bean:write name="CopyListFormBean" property='<%= "beans[" + ctr + "].sprache" %>' />
<html:hidden property='<%= "beans[" + ctr + "].sprachId" %>' />
<html:hidden property='<%= "beans[" + ctr + "].listId" %>' />
<html:submit />
When Submitting the Form i get the 'popular' ErrorMessage
at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(
at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(
at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(
at org.apache.commons.beanutils.PropertyUtils.getProperty(
at org.apache.commons.beanutils.BeanUtils.setProperty(
at org.apache.commons.beanutils.BeanUtils.populate(
Any Idea? I'm totally frustrated - maybe i need a break.
Priya Selvaraj

Joined: Mar 27, 2002
Posts: 4
I had the same problem.
I solved it by initializing the phone array in the setter method.
For Example:
private String[] phone = null;
public void setPhone(int index, String value) {

if(phone==null) {
phone = new String[100];
catch (Exception e) { System.out.println("Exception in setPhone : " + e);}
I agree. Here's the link:
subject: Trouble with indexed properties
It's not a secret anymore!