tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alejandra De Leon <>
Subject RE: forEach Problem
Date Mon, 20 Jan 2003 21:02:57 GMT
Yes, but if I add 1 to de end it didn't iter only once it iter twice, and to
<option> tag apperar.
I don't have any problem when I have different values for the begin and end
attribute, but I do have when the values are the same and if I add 1 to the
end it's not what I need. 
I have to display begin year and end year and sometimes this variables are
differents but sometimes they have equals values.

Another suggestion?

-----Original Message-----
From: []
Sent: Lunes, 20 de Enero de 2003 05:43 p.m.
Subject: Re: forEach Problem

>>>>> "Alejandra" == Alejandra De Leon <> writes:

    Alejandra> I'm having a problem with foreach tag using begin and end
    Alejandra> The code I have is:
    Alejandra> <c:forEach begin="${erliestYear}" end="${latestYear}"
    Alejandra>          <option value="<c:out
    Alejandra> test="${status.index == statisticsForm.toYear}"><c:out
    Alejandra> selected"/></c:if>><c:out value='${status.index}'/></option>
    Alejandra> </c:forEach>

    Alejandra> and when earliestYear it's equals to lastYear It doesn't
display the option
    Alejandra> tag.
    Alejandra> I suppose that it should be like in Java that runs the loop

    Alejandra> This is a bug or it's not possible to use a <foreach> only to
run once.

Just make "end" equal to "${latestYear + 1}".

David M. Karr          ; Java/J2EE/XML/Unix/C++   ; SCJP; SCWCD

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message