HTML files can contain tags that are executed on the server. For general information about server-parsed HTML tags, see the Sun Java System Web Server 7.0 Update 4 Developer’s Guide.
In Web Server 7.0, you can define your own server-side tags. For example, you could define the tag HELLO to invoke a function that prints Hello World!You could have the following code in your hello.shtml file:
<html> <head> <title>shtml custom tag example</title> </head> <body> <!--#HELLO--> </body> </html> |
When the browser displays this code, each occurrence of the HELLO tag calls the function.
The general steps for defining a customized server-parsed tag are:
Defining the Functions that Implement the Tag.
You must define the tag execution function. You must also define other functions that are called on tag loading and unloading, and on page loading and unloading.
Writing an Initialization Function.
Write an initialization function that registers the tag using the shtml_add_tag function.