tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbeam <sb...@onsetcorps.net>
Subject Re: JSTL forEach acting funny
Date Thu, 02 Dec 2004 13:13:41 GMT
On Thursday 02 December 2004 08:07 am, Allistair Crossley wrote:
> you need
> 
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
> 
> at the top of your jsp though.

Have that - if I didn't then <c:forEach ...> would show up in the 
output, but it doesn't. 

My apologies, I should have mentioned I was doing the "mySQL DBCP 
Example" specifically. Anyway, here is the whole jsp:

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

<sql:query var="rs" dataSource="jdbc/TestDB">
select id, foo, bar from testdata
</sql:query>

<html>
  <head>
    <title>DB Test</title>
  </head>
  <body>

  <h2>Results</h2>
  
<c:forEach var="row" items="${rs.rows}">
    Foo ${row.foo}<br/>
    Bar ${row.bar}<br/>
</c:forEach>

  </body>
</html>
=================================

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message