File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSTL and hashmap Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply 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: 56221
    
  13

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 56221
    
  13

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: 56221
    
  13

"gguer gguer", please check your private messages for an important administrative matter.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL and hashmap
 
Similar Threads
dynamic-attributes doubt
struts dynavalidatorBean with HashMap & JSTL
Implementation of google charts in JSP
JSTL: problem
JSF TreeMap Iteration Problem Using JSTL In XHTML