• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[taglibs] Iterating over a Hashtable

 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic