tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Sanchez <apa...@cousas.net>
Subject RE: Simple iteration
Date Sun, 12 Oct 2003 21:56:47 GMT
Why not

<c:forEach begin="0" end="20" var="i">
	<option> 
		<c:out value="${currentYear-i}"/>
	</option>
</c:forEach>


> -----Mensaje original-----
> De: Nic Werner [mailto:nic@link11.net] 
> Enviado el: domingo, 12 de octubre de 2003 23:34
> Para: taglibs-user@jakarta.apache.org
> Asunto: Simple iteration
> 
> 
> This is a simple question, but is there any way to count 
> *backwards* in JSTL?
> 
> Using the forEach tag, if begin=10 and end=0, I get an: 'end' 
> < 0 error
> 
> I've also tried using step="-1" to no avail.
> 
> Basically, I want to create a year pulldown box which starts 
> at the currentyear and then displays the previous twenty years.
> 
>  <c:forEach begin="${currentYear}" end="${currentYear-20}" 
> step="-1" var="year"> <option> <c:out 
> value="${year}"/></option> </c:forEach>
> 
> - 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


Mime
View raw message