aspose file tools*
The moose likes JSP and the fly likes Retrieve Values From Hashtable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Retrieve Values From Hashtable" Watch "Retrieve Values From Hashtable" New topic
Author

Retrieve Values From Hashtable

naro pad
Ranch Hand

Joined: May 07, 2008
Posts: 58

Ok I know this is very simple but unfortunately I can't do it. My problem is that I want to retrieve values from a Hashtable. I have this:


How can I make a loop while the Hashtable has elements to get the value?

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60063
    
  65

<c:forEach> will loop over a Map without difficulty. Just be aware that the iteration items will be instances of Map.Entry.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
naro pad
Ranch Hand

Joined: May 07, 2008
Posts: 58

I have try to do it by this way:

but I have debug it and saw that lsAssement when is created although I have only 2 keys in hashtable is create a table of size 10 showing me the 2 keys at positions 1 and 2 of the table, 0 position is empty and then 'Ass_id' is getting the second key value instead of the first one.
Why is that?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60063
    
  65

If you are doing this in a JSP, why the Java rather than JSTL and EL?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retrieve Values From Hashtable
 
Similar Threads
servlet and checkbox state
how to retrieve value from autogenerated(oracle sequence) column in a servlet.
help with testing a hashtable
Pass radio button/ text box responses from one page to another
Collections.synchronizedMap