tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "N. Chen" <nic...@u.washington.edu>
Subject Re: expression that contains expression
Date Thu, 03 Jul 2003 19:41:59 GMT


well, actually yes.  Assuming name is an array or something similar:

 <c:forEach begin="1" end="4" var="index">
     <c:out value='${name[index]}'/>
 </c:forEach>

On Thu, 3 Jul 2003, Taavi Tiirik wrote:

>
> Hi, I have variable names like name1, name2, name3, etc. in JSTL.
>
> Instead of hard coding the expressions like this ${name1}, ${name2}
> I would like to use them in a loop.
>
> The following syntax is not valid of course. Is there a way how to
> achieve this:
>
> <c:forEach begin="1" end="4" var="index">
>     <c:out value="${name${index}}"/>
> </c:forEach>
>
> thanks,
> Taavi
>
>
> ---------------------------------------------------------------------
> 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