aspose file tools
The moose likes Java in General and the fly likes java.util.ArrayList Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "java.util.ArrayList" Watch "java.util.ArrayList" New topic
Author

java.util.ArrayList

Krupa Eng
Ranch Hand

Joined: Sep 05, 2003
Posts: 60
Hi,

I have a java class called myObject with three properties like prop1,prop2,prop3.
I have another object called objectslist with an arraylist of myobjects as its properties and objlistprop.

myObject{
prop1;
prop2;
prop3;
}

Objectslist{
arraylist myobjects
prop2
}

in my jsp I want to update prop1 of my object where myobject is [objectlist.get(i)] ith element of the list.

Thanks,
Krupa


Krupa
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24054
    
  13

Please don't post the same thread to multiple forums -- it's just a waste of people's time.

Now: do you have a question?


[Jess in Action][AskingGoodQuestions]
Krupa Eng
Ranch Hand

Joined: Sep 05, 2003
Posts: 60
Sorry about posting in 2 places. I didn't know which one is the right place.

My question is how can I update the object.

for example.

iterator it = mylist.getIterator
while (it.next){
(MyObject)currobj = (MyObject) it.next();
if(currobj.getProp2.equals("AB")){
currobj.setProp3("XYZ");
}
}

The setProp3 is giving me an error.

How can I set the prop3 value.

Thanks
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24054
    
  13

Originally posted by Krupa Eng:

The setProp3 is giving me an error.


What's the error message? Is it a runtime error, or a compiler error? If it's the latter, does it point to a particular line of code? I don't think we can help unless we understand the problem you're having.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: java.util.ArrayList
 
Similar Threads
Struts OGNL how to acces vector elements
How to Group a Collection of Pojo's based on some pojo property?
Hibernate - how to map cross-table dependence?
Combinig 2 struts properties using AND Operator
Matching a left square bracket at beginning of file