Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6
-
None
-
None
-
Operating System: other
Platform: Other
-
28358
Description
I'm experiencing problems porting an existing struts 1.1 application on JDK 1.4.
Debugging the code, i have seen that the problem occur in getIndexedProperty,
because on jdk 1.3.1_02 return an instance of IndexedPropertyDescriptor while
in jdk 1.4.1_02 not!
To use indexed property on struts, whe declare 2 methods on the ActionForm: one
that return the entire list and one that return an indexed element
A simple class that reproduce the problem is:
public class FooForm extends ValidatorForm
{ protected List childs = new ArrayList(0); ... }public List getChilds()
{ return childs; } public ChildsBean getChilds(int index) {
if (index + 1 > childs.size()) {
for (int i = childs.size(); i < index + 1; i++)
}
return (ChildsBean) childs.get(index);
}
....
}
and the problem occur when i preload the forms values using a code like this
for (int j = 0; j < newChilds.size(); j++) {
BeanUtils.copyProperties(PropertyUtils.getIndexedProperty
(valBean,"childs",j), newChilds.get(j));
}