This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes JSTL and hashmap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL and hashmap" Watch "JSTL and hashmap" New topic
Author

JSTL and hashmap

Alex Florentino
Ranch Hand

Joined: Dec 12, 2006
Posts: 48
Hi all,

I have HashMap with dynamic key, sample:



but I get an error when I try run this jsp. I think that problem is:


when I get my hashmap value with my dynamic key.

resume: how I get my hashmap value when I create my key dynamic .

very thanks
Sid Murrey
Ranch Hand

Joined: Jul 07, 2008
Posts: 58
This could be completely wrong, but a guess:

[ July 10, 2008: Message edited by: Cedric Meury ]
Alex Florentino
Ranch Hand

Joined: Dec 12, 2006
Posts: 48
it is not working, but
working
Sid Murrey
Ranch Hand

Joined: Jul 07, 2008
Posts: 58
Nice! Good to know.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

The ${} surrounds the entire EL expression. It is not some sort of "fetch" operator.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Alex Florentino
Ranch Hand

Joined: Dec 12, 2006
Posts: 48
Originally posted by Bear Bibeault:
The ${} surrounds the entire EL expression. It is not some sort of "fetch" operator.


I my sorry, but I not understand ? because ${myhash[myinternalvar]} works.

thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Because in that example, the ${} surrounds the entire El expressions as I stated.
John Abrams
Greenhorn

Joined: Sep 14, 2008
Posts: 1
This is about as straight forward as it gets:
<table>
<c:forEach items="${requestScope.mapToIterate}" var="entry">
<tr><td>${entry.key}</td><td>${entry.value}</td></tr>
</c:forEach>
</table>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

"gguer gguer", please check your private messages for an important administrative matter.
 
wood burning stoves
 
subject: JSTL and hashmap
 
Similar Threads
struts dynavalidatorBean with HashMap & JSTL
Implementation of google charts in JSP
JSTL: problem
JSF TreeMap Iteration Problem Using JSTL In XHTML
dynamic-attributes doubt