• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL and hashmap

 
Alex Florentino
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This could be completely wrong, but a guess:

[ July 10, 2008: Message edited by: Cedric Meury ]
 
Alex Florentino
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is not working, but
working
 
Sid Murrey
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice! Good to know.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ${} surrounds the entire EL expression. It is not some sort of "fetch" operator.
 
Alex Florentino
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because in that example, the ${} surrounds the entire El expressions as I stated.
 
John Abrams
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"gguer gguer", please check your private messages for an important administrative matter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic