Server-Side Dynamic Elements
Server-side dynamic elements are the simplest type of element to create and are supported by all web browsers. Needless to say, they are the most commonly used.Server-side dynamic elements produce HTML at runtime. This HTML is composed of the same HTML elements you use when you're creating a static web page. Like static elements, dynamic elements display formatted text, images, forms, hyperlinks, and active images. WebObjects provides several dynamic elements. For a complete list, see the online book Dynamic Elements Reference.
For an example of dynamic elements in action, look at the CyberWind sample application. It's located in <DocRoot>/WebObjects/Examples/Java/CyberWindJava, where <DocRoot> is your web server's document root. When you run CyberWind, its first page contains a list of hyperlinks, shown in Figure 9.
When you run CyberWind, the WORepetition walks through an array of strings that the component's code supplies. For each item in the array, it displays a hyperlink whose text is the text of the string item in the array. In this array, there are two strings-"See surfshop information" and "Buy a new sailboard"-so the WORepetition creates two hyperlinks, each containing the appropriate text.
Table of Contents Next Section