Re: JSP beans retrieval with a for loop



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 !
.



Relevant Pages

  • Re: JSP beans retrieval with a for loop
    ... Arne Vajhøj wrote: ... but I don't know how to iterate the list of beans ...
    (comp.lang.java.programmer)
  • forEach tag: Whats wrong with this snippet code
    ... Using Struts and JSTL, I try to iterate over a collection of Beans but ...
    (comp.lang.java.help)
  • Re: My Good Cookbook Shelves
    ... Today I recieved the pamphlet from ... Grandma Browns Oven Baked Beans... ... The hospital where my sister and I were born was a block away from the plant, so chocolate was probably one of the first aromas I smelled. ... There is one full shelf for barbecue/grilling books, centrally located so the SO can find them. ...
    (rec.food.cooking)
  • To TreeModel or not to TreeModel
    ... I'm working on an app for a bookshop. ... The owner is selling used books, and since he is a bit of an order freak he has categorized these books in about 300 hundred different catalogs, most of which are subcatalogs at varying depth. ... But it turns out that I want to iterate over the catalogmuch as I would like to iterate over a collection. ...
    (comp.lang.smalltalk.dolphin)
  • Re: Tetration again!
    ... tetration, which he calls T, because the function to iterate, ... the other is a nicely edited one by bruce berndt ... separated into 5 books ... including basic recursions ...
    (sci.math)