What kind of sick civilization would produce code like this?
<c:forEach var="item" items="${sessionScope.cart.items}">
<c:set var="book" value="${item.item}" />
<c:set var="bookId" value="${book.bookId}" />
<sql:query var="books"
sql="select * from PUBLIC.books where id = ?" >
<sql:param value="${bookId}" />
</sql:query>
<jsp:useBean id="inventory"
class="database.BookInventory" />
<c:forEach var="bookRow" begin="0"
items="${books.rowsByIndex}">
<jsp:useBean id="bookRow" type="java.lang.Object[]" />
<jsp:setProperty name="inventory" property="quantity"
value="${bookRow[7]}" />
<c:if test="${item.quantity > inventory.quantity}">
<c:set var="sufficientInventory" value="false" />
<h3><font color="red" size="+2">
<fmt:message key="OrderError"/>
There is insufficient inventory for
<i>${bookRow[3]}</i>.</font></h3>
</c:if>
</c:forEach>
</c:forEach>
Posted by jjwiseman at March 13, 2005 04:06 PMI don't know that "civilization" is really the word.
Posted by: Nick on March 13, 2005 05:20 PMOurs.
Posted by: Guan Yang on March 13, 2005 09:41 PMAnd I thought Template-Toolkit.org was perverted.
Posted by: Damir on March 13, 2005 11:42 PMWhere does this code come from?
Posted by: Pascal Costanza on March 14, 2005 01:04 AMWelcome to the real world.
(I've seen worse. Much worse...)
Hey! That looks a bit like LOOP!
Posted by: Marcin on March 14, 2005 04:01 AMThese are JSP tags.
Posted by: wcn on March 14, 2005 07:05 AMas clunky as java and esp. jsp can be, don't all you highly-evolved lispers come away with the impression that it *has* to be done that way (it's a crime to mix data access/business logic & presentation like that in any language)
Posted by: jim on March 14, 2005 08:41 AMThank goodness my eyes are too tired to bleed.
Posted by: bi on March 15, 2005 02:00 AMLooks like the evolution of language: http://homepages.inf.ed.ac.uk/wadler/language.pdf
Posted by: Florian on March 17, 2005 04:32 AM