tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross, Douglas" <DR...@Kronos.com>
Subject RE: Looping with paramValues
Date Mon, 13 Sep 2004 15:56:25 GMT
Helios,

Small correction (I think), did you mean ...
><c:forEach var='entry' items='${params}'>
>   <c:if test="${entry.key == 'test1'>
>     <c:out value="${entry.value}"/>
>   </c:if>
></c:forEach>
Note: I switched var and items values.

-----Original Message-----
From: Helios Alonso [mailto:halonso@atg.com.uy] 
Sent: Monday, September 13, 2004 11:28 AM
To: Tag Libraries Users List
Subject: Re: Looping with paramValues

The items in the params collection are Entries (java.util.Map.Entry I 
think).  So you can access two properties at each entry:  key and value.

You can do (changing paramValues to entry for clarity):

><c:forEach var='params' items='${entry}'>
>   <c:if test="${entry.key == 'test1'>
>     <c:out value="${entry.value}"/>
>   </c:if>
></c:forEach>


At 10:50 13/09/2004 +0100, you wrote:
>Closest I've got in my extant code is something like this:
>
><c:forEach var='params' items='${paramValues}'>
>   <c:if test="${params.key == 'test1'>
>     <c:out value="${params.value[0]}"/>
>   </c:if>
></c:forEach>
>
>Regards,
>
>Malcolm.
>
>
>Nic Werner wrote:
>>Hi,
>>    Is there a '.key' accessor for paramValues? Basically I only want
to 
>> access the variables that match a certain index and do comparison
work 
>> with them....
>>      I'm familiar with accessing data using
paramValues.var_name[index], 
>> and I'm familiar with looping through params with only one value:
>><c:forEach items="${param}" var="params" varStatus="status">
>>    <c:out value="${params.key} -- ${params.value}"/><BR>
>>    </c:forEach>
>>The problem with paramValues is that I have to specify a variable
name, 
>>while params lets me use '.key'.
>>Thanks for your help,
>>- Nic
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org



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


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


Mime
View raw message