This set of examples shows how to iterate over the contents of collections. In HTML, collections are usually output using a element specifically designed to support repetition (li, option, tr, or dt/dd). Dynamator allows any HTML element to be repeated for iteration. Dynamator can generate code to support any JDK 1.1 or 1.2 collection: array, Vector, Enumeration, Dictionary, Properties, Iterator, and Map. This tutorial covers only JDK 1.1 collections. Iteration is accomplished by adding a 'foreach' element to the Dynamator entry for an id or class value. In the 'foreach' element, you can specify attributes that identify the type of the collection and the name of each Java variable that needs to be generated to support iteration. Most of the time, such fine-grained control is not needed. In this tutorial, we will be demonstrating use of only the required attributes. For complete information about the syntax of the 'foreach' element in Dynamator for JSP, see the man page for Dynamator Language Support for JSP. The 'foreach' element has two required attributes:
Examples
|
|||||||||||||||||||||||
Page last updated 01 April 2004 |
Copyright 2001-2004 by Jay Dunning. All rights reserved. |
hosted by |