File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 iterate over a Map

 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • 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: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • 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
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic