| Author |
how to iterate a collection of data objects using <logic:iterate> and <bean:write>
|
Bushra Binte
Ranch Hand
Joined: Nov 07, 2006
Posts: 60
|
|
Hi,I am trying to iterate a collection of objects.These objects contains 5 fields to be displayed.
In action class,i put the collection as
And in jsp ,iterate as
When i run the application no error is displayed ,but ,result is,
[object][object][object][object][object]
displayed.
How can we get the value stored inside the object that is in a collection.
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
|
|
Well this is a strange sort of behavior. First of all I am assuming that you have getter properties for all your properties in RegD class. Then one thing that I'm not clear on is that why are you using a list when there is only one instance of RegD class in the list. Maybe you have shown some incomplete code.
Also by looking at the ouput, I can only think of the toString method of AbstractCollection class. I know I may be wrong on this. But there is no way that I know of when the code should display that kind of output. Maybe there is something wrong with your action and there is a List as elements in your list. Still I'm not sure how can that sort of output can come...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
 |
|
|
subject: how to iterate a collection of data objects using <logic:iterate> and <bean:write>
|
|
|