ContentsWeb Page DesignUsing Variables
Previous: About HTML Editors | Next: Setting New Variables

Using Variables

Using variables is as simple as placing $variable_name where you want the contents of the variable to appear in the page.  The variable name can take one of two basic forms: a regular variable (such as "$PageName") or an array element (such as "$JDBC(DriverName)").

Variables come from several sources:

Naming

Variable names are case sensitive.  By convention, variables which begin with upper-case letters are always from WELD commands which are written in Java.  Those variables which are standard must therefore begin with an upper-case letter.  Conversely, variables which you create should always begin with a lower-case letter.

What should be stored in a variable

Since variables can be expanded anywhere in the document, they can contain simple data nested in HTML elements or complete HTML page elements.  Java programmers are advised only to provide data, but web designers can use this technique without being restricted to data.

Life span of variables

Variables are assigned to the end user's session.  Sessions are maintained on the server as long as the user continues to visit your pages.  Most servlet environments have a configurable session time-out (usually 15 to 30 minutes of inactivity), and most web applications provide a way for the user to explicitly terminate their session.  This means that variables carry from page to page until the session terminates.


ContentsWeb Page DesignUsing Variables
Previous: About HTML Editors | Next: Setting New Variables

Modified: Tue Apr 18 13:39:31 EDT 2000