struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erez Efrati <er...@netmedia.net.il>
Subject RE: JSTL Map Accessors
Date Wed, 07 Jul 2004 00:22:22 GMT
Denis, 

Your code: (just as you typed it) seems fine except for the spaces in
'... items = ${...'.

<c:forEach items = "${masterList}" var="masterKey">
<c:out value="${firstMap[masterKey]}" />
</c:forEach>


I use JSTL code in my project that does exactly what you are trying to
do and it works fine. I suggest doing the following:
1. Do you really have spaces before and after the '=' sign in 'items =
'? If so try removing them.
2. Put a <c:out value="${masterKey}" /> in the loop just to make sure
you are getting those strings in the array.

Hope this helps,

Erez

-----Original Message-----
From: Denis Avdic [mailto:da@adamstechcenter.com] 
Sent: Tuesday, July 06, 2004 8:56 PM
To: Struts Users Mailing List
Subject: JSTL Map Accessors

Hello,

I have a problem that I can't seem to get around.

I have a number of maps in my request, all keyed by same sequence of
String
keys that are contained within an ArrayList in that same request.
My question is how do I get to the values in those maps?

I've tried variations on:

<c:forEach items = "${masterList}" var="masterKey">
<c:out value="${firstMap[masterKey]}" />
</c:forEach>
but that obviously looks for entries keyed to "masterKey" and not the
value
contained in the masterKey variable.

How would I evaluate masterKey before firstMap[] is evaluated?  Is that
even
possible?  What are my alternatives?

Thanks a lot,

Denis


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message