I had a question about this part of PropertyUtils.java.
 
====================================================
 
           public static PropertyDescriptor getPropertyDescriptor(Object bean,
                      String name)
 
<snipped>
 
     PropertyDescriptor descriptors[] = getPropertyDescriptors(bean);
     if (descriptors == null)
        return (null);
     for (int i = 0; i < descriptors.length; i++) {
         if (name.equals(descriptors[i].getName()))
              return (descriptors[i]);
     }
========================================================
The method getPropertyDescriptor 
calls
        getPropertyDescriptors(bean)
and iterates through them to get a match on the name.
 
Incase the Bean class contains
      ArrayList items;
 
It requires to have 2 getItems methods
 1)   ArrayList getItems() - to be used when you use the
            <logic:iterate name="Beanname" property="items" >
2)  It also requires an indexed getter
        Item getItem(int index)
    to handle the form input fields within the iterate tag.
 
If you find the wrong descriptor first, you get a NoSuchMethodException
I propose getPropertyDescriptor take another parameter (which says whether its an Indexed
property we are looking for) or create another
getIndexedPropertyDescriptor.
 
I'll probably do that to handle nested, indexed properties to get <logic:iterate> to work...
 
      -Chandan.

 

Reply via email to