tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serge Knystautas <ser...@lokitech.com>
Subject Re: forEach => Exception javax/servlet/jsp/jstl/core/LoopTagSupport
Date Thu, 28 Aug 2003 14:17:30 GMT
No, using var to get the index value in a non-items forEach usage is 
perfectly legal.  Kris's almost exact same example is in the JSTL spec 
6.1.4.  What he's doing should work.

But Kris, the JSTL is designed to fast fail, rather than throw 
exceptions.  The operating principle was to have tags fast fail whenever 
possible (such as c:out with a null value) rather than require a lot of 
extra typing to declare variables and handle null values and exceptions.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com

Steve Raeburn wrote:
> You need to use the status variable to get the current loop index.
> 
> <c:forEach begin="3" end="20" step="3" varStatus="status">
>     <c:out value="${status.index}"/>
> </c:forEach>
> 
> Steve 
> http://www.ninsky.com/struts/
> 
> 
> 
>>-----Original Message-----
>>From: news [mailto:news@sea.gmane.org]On Behalf Of Thilo Schwidurski
>>Sent: August 27, 2003 11:59 PM
>>To: taglibs-user@jakarta.apache.org
>>Subject: Re: forEach => Exception
>>javax/servlet/jsp/jstl/core/LoopTagSupport
>>
>>
>>Kris Schneider wrote:
>>
>>>Not really sure why it's not working for you, but the following 
>>
>>works just fine
>>
>>>with Standard 1.0.3 on Tomcat 4.1.24:
>>
>>Thanks, Kris.
>>
>>Standard 1.0.3 on Tomcat 4.1.24 is also my setup.
>>
>>[your example code]
>>
>>My problem is still, that *already* the following less "sophisticated" 
>>code fails:
>>
>><c:forEach var="i" begin="3" end="20" step="3">
>>    <c:out value="${i}"/>
>></c:forEach>
>>
>>Well, I am back using struts' logic:iterate now.
>>This is really frustrating... :-/
>>
>>Thanks,
>>Thilo.



Mime
View raw message