Hi
I have a java bean with the following attributes and their getters and
setters.
************************************************************
public class OrganisationType implements Serializable {
Long id;
String code;
String description;
int version;
Collection arr =new ArrayList();
HashMap hsh =new HashMap();
Getter and setters follow.......................
************************************************************
I am using the following code to populate the array list
OrganisationType orgna = new OrganisationType();
orgna.setCode("12121");
JXPathContext contexts = JXPathContext.newContext(orgna);
contexts.setValue("arr[1]","12");
****************And the Exception I get is ***************************
org.apache.commons.jxpath.JXPathException: Exception trying to set value
with xpath arr[1]; Index: 0, Size: 0
at
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.setValue(JXPathC
ontextReferenceImpl.java:421)
at
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.setValue(JXPathC
ontextReferenceImpl.java:412)
at TestJxPath.main(TestJxPath.java:36)