|
NOTE:
These slides have not been updated since 2003. They have been superseded by the book
Anders Møller and Michael Schwartzbach, February 2006 |
|
| INTERACTIVE WEB SERVICES WITH JAVA |
|
Part of the philosophy behind JSP(/ASP/PHP) is:
This quickly breaks down:
The tag code:
<c:forEach var="item" items="$session:cart.items">
...
<tr>
<td align="right" bgcolor="#ffffff">
<c:expr value="$item.quantity"/>
</td>
...
</c:forEach>
|
abbreviates the JSP code:
<%
Iterator i = cart.getItems().iterator();
while (i.hasNext()) {
ShoppingCartItem item =
(ShoppingCartItem)i.next();
...
%>
<tr>
<td align="right" bgcolor="#ffffff">
<%=item.getQuantity()%>
</td>
...
<%
}
%>
|
This only works under a lot of assumptions:
|
| COPYRIGHT © 2002-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH |
|