• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 iterate over a Map

 
Joe Harry
Ranch Hand
Posts: 10110
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I'm trying to iterate over a Map that contains an Object as a Key and has a List of other Objects as value.

For example., Map < MyObject, List < OtherObject> > myMap.

I need to iterate over myMap and display a couple of variables from the key and the remaining couple from the value. In essence I need to do something like

myMap.MyObject.firstName and myMap.MyObject.lastName and get the other values from the value as myMap.OtherObject.address1.street and so on....

I have a simple iterator as below:

 
Joe Harry
Ranch Hand
Posts: 10110
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I got it to work. This is what I did:

 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why you are storing heavy object in session, why you are not using applicationAware interceptor for this purpose.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic