aspose file tools*
The moose likes JSP and the fly likes [taglibs] Iterating over a Hashtable 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 "[taglibs] Iterating over a Hashtable" Watch "[taglibs] Iterating over a Hashtable" New topic
Author

[taglibs] Iterating over a Hashtable

Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
Hey,
Having a problem iterating over a Hashtable. The iterator is getting the next entry set in the hashtable. Instead, I want to get the values.
Enough blabbering. Here's the code:

You see the first one will cause an error but the second one, a scriptlet works (when the first one is omitted).

--
edited out the @# smilies.
--
[ October 23, 2002: Message edited by: Garrett Smith ]

comp.lang.javascript FAQ: http://jibbering.com/faq/
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
Well noone answered this so I will.

Prints: class java.util.Hashtable$Entry
So now I now exactly which class I'm dealing with: Map.Entry.

Prints: jgirl-a******** (self-censorship, here--you figure it out.)
Explanation:
users -- Map.entry
users.value -- [com.dhtmlkitchen.User]
users.value.username -- jgirl-a******** (from getUsername())
I wonder how this converts users.value to a com.dhtmlkitchen.User. users.value should be a java.lang.Object. I didn't cast anything. Tag magic...
--
I already checked "Disable smilies in this post."
Goddam smilies.
---
[ October 23, 2002: Message edited by: Garrett Smith ]
[ October 23, 2002: Message edited by: Garrett Smith ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [taglibs] Iterating over a Hashtable