tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: forEach => Exception javax/servlet/jsp/jstl/core/LoopTagSupport
Date Wed, 27 Aug 2003 15:38:24 GMT
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:

<%@ page contentType="text/plain" %>
<%@ page import="java.util.*" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

<%
Object[] testData = { "0", "1", "2" };
List test = Arrays.asList(testData);

Map stock = new HashMap();
stock.put("test", test);
pageContext.setAttribute("stock", stock);
%>

<c:forEach var="i" begin="3" end="20" step="3">
    <c:out value="${i}"/>
</c:forEach>

<c:forEach var="item" items="${stock.test}">
   <c:out value="${item}"/>
</c:forEach>

Quoting Thilo Schwidurski <thilo.s@web.de>:

> Hi,
> 
> This...
> 
> <c:out value="${stock.test[0]}"></c:out>
> 
> ...works fine (with stock.test is of class ArrayList).
> 
> 
> This...
> 
> <c:forEach var="i" begin="3" end="20" step="3">
>     <c:out value="${i}"/>,
> </c:forEach>
> 
> ...and this...
> 
> <c:forEach var="item" items="${stock.test}">
>    <td><c:out value="${item}"/></td>
> </c:forEach>
> 
> ... results in:
> 
> javax.servlet.ServletException: javax/servlet/jsp/jstl/core/LoopTagSupport
> 
> 
> So it seems that the forEach tag is kind of "broken". Does anybody have 
> an idea what I am doing wrong here?
> I am using jakarta-taglibs-standard-1.0.3
> Where can I download the sources for 1.0.3 so that I can debug at least?
> 
> Regards,
> Thilo.

-- 
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

Mime
View raw message