Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to iterate a collection of data objects using <logic:iterate> and <bean:write>

 
Bushra Binte
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic