You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2004/04/13 09:50:44 UTC
DO NOT REPLY [Bug 28358] New: -
Problems on indexed property with JDK 1.4
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28358>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=28358
Problems on indexed property with JDK 1.4
Summary: Problems on indexed property with JDK 1.4
Product: Struts
Version: 1.1 Final
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Unknown
AssignedTo: dev@struts.apache.org
ReportedBy: franco.caponi@tin.it
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++) {
childs.add(new ChildsBean());
}
}
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));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org