JOT Templates > An Example

A JOT Template Example

The following example illustrates a JOT Template. JOT.CustomerName is a JOT Token that accesses the CustomerName JOT Bean property. JOT.Items is the name of a JOT Bean with a TotalPurchase property and a repeating list of ProductName and ProductPrice properties.

<html>
<!-- [Customer name in browser window title] -->
<title>JOT.CustomerName Shopping Cart</title>
<body>

<center>
<!-- [Customer name] -->
<h3>Shopping Cart for JOT.CustomerName</h3>

JOT.If(JOT.Items.More) <!-- [beginning of IF section] -->
<table width=400 border=2>

<!-- [Repeated rows for each shopping cart item] -->
JOT.Repeat(JOT.Items.Next)
<tr>
    <td align=left>JOT.Items.ProductName</td>
    <td align=right>JOT.Items.ProductPrice</td>
</tr>
JOT.End <!-- [end of Repeat loop] -->

<tr>
    <!-- [Total for customer shopping cart] -->
    <td colspan=2 align=right>JOT.Items.TotalPurchase</td>
</tr>

</table>
JOT.End <!-- [end of IF section] -->
</center>

</body>
</html>
© 2007 JOT Object Technologies