File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Access a value in HashMap where key is an object and value is a collection of VO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Access a value in HashMap where key is an object and value is a collection of VO" Watch "Access a value in HashMap where key is an object and value is a collection of VO" New topic
Author

Access a value in HashMap where key is an object and value is a collection of VO

amarshi mohanty
Ranch Hand

Joined: Jul 01, 2008
Posts: 110
Hi All,

I have the below code in a action class .


The listValues has collection of VO's .
How to access the value in jsp using EL?


SCJP (97%), SCWCD (95%))
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67



[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
amarshi mohanty
Ranch Hand

Joined: Jul 01, 2008
Posts: 110

if i iterate the hm like :


m getting:

value = 20100128-2=[class se.ralip.openarchive.vo.WfmsInvoiceManagementVO[ supplier=Mohanty: documentId=54318: invioceNumber= 3386675205: invoiceDate=19/12/2008: dueDate=19/12/2009: amount=400.00: arrivalDate=null: status=archived: scanno=123_457 ], class se.ralip.openarchive.vo.WfmsInvoiceManagementVO[ supplier=Mohanty: documentId=54319: invioceNumber= 3386675205: invoiceDate=19/12/2008: dueDate=19/12/2009: amount=400.00: arrivalDate=null: status=archived: scanno=123_458 ], class se.ralip.openarchive.vo.WfmsInvoiceManagementVO[ supplier=Mohanty: documentId=54320: invioceNumber= 3386675205: invoiceDate=17/12/2008: dueDate=18/12/2009: amount=4010.00: arrivalDate=null: status=archived: scanno=123_459 ]]


so how can i giv the {hashMapItems.key.supplier}
do i need [] operator for this?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Sorry, the jumble you posted makes no sense to me.

If you want to access a member of the map by key, use the syntax I already posted. If what's returned by that is a bean (or another map) you can keep going. For example:

This assumes that the keys are valid identifiers. If the keys are not identifiers, you need to use the [] notation.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Access a value in HashMap where key is an object and value is a collection of VO