Any changes made to an Object will reflect in collection also ; for your case ,have to remove and then add
-----Original Message----- From: Raghuveer [mailto:[EMAIL PROTECTED] Sent: May 18, 2006 5:15 PM To: user@struts.apache.org Subject: object modify in collection index I have 5 objects(java beans) in Collection. I need retrive object from index 3 in collection modify it and add to same index. What is best collection for this requirement. At present i tried this with arraylist. But in addition to object with 3 rd index modified i am getting one more object added in Arraylist i.e 6 objects in collection. As per below code the modified object at index 3 is updated in arlCollectionOrderRfq collection. But how about the same collection in actionform in my struts application. This collection of objects is a method in Struts ActionForm ArrayList arlCollection = orderPartsActionForm.getArlCollection(); if(arlCollection !=null && arlCollection .size()>0){ obg = (TestObject)arlCollection .get(3); obg.setPart(strPart); }//end if --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message has been automatically scanned for viruses --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]