Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[taglibs] Iterating over a Hashtable

 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic