Re: JSP beans retrieval with a for loop
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Sun, 09 Mar 2008 15:56:36 -0400
Vittorix wrote:
Arne Vajhøj wrote:Have your backend Jaca code return a collection of BookBean. It is
very easy to iterate over that.
I tried that before, but I don't know how to iterate the list of beans
[example from a contact page - you should easily be able
to translate to books]
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
....
<table border>
<tr>
<th>Navn</th>
<th>Telefon</th>
<th>Email</th>
</tr>
<c:forEach var="c" items="${allc}">
<tr>
<td><c:out value="${c.name}"/></td>
<td><c:out value="${c.phone}"/></td>
<td><c:out value="${c.email}"/></td>
<tr>
</c:forEach>
</table>
The above just assume that request has an attribute under the
name "allc" that is a collection of a bean class with name,
phone and email properties.
Arne
PS: It is not even utilizing JSP 2.0 !
.
- Follow-Ups:
- Re: JSP beans retrieval with a for loop
- From: Vittorix
- Re: JSP beans retrieval with a for loop
- References:
- JSP beans retrieval with a for loop
- From: Vittorix
- Re: JSP beans retrieval with a for loop
- From: Arne Vajhøj
- Re: JSP beans retrieval with a for loop
- From: Vittorix
- JSP beans retrieval with a for loop
- Prev by Date: Re: JSP beans retrieval with a for loop
- Next by Date: Re: C# versus Java for Interactive Images
- Previous by thread: Re: JSP beans retrieval with a for loop
- Next by thread: Re: JSP beans retrieval with a for loop
- Index(es):
Relevant Pages
|