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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
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: 61654
    
  67

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: 61654
    
  67

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: 61654
    
  67

"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