JavaServer

Server Side Includes


Documentation / Developer Docs / Administrator Docs / Index / Features

In the Java Web Server, Server Side Includes (SSI) is just another way to load and invoke local as well as remote servlets.

Syntax of Server Side Include tags

The syntax of a SSI tag is very similar to the applet tag. It is as follows.
<servlet code=DateServlet.class codebase=http://blitz/ initParam1=val1 initParam2=val2>
<param name=serviceParam1 value=val3>
<param name=serviceParam2 value=val4>
.
.
</servlet>
The code is the name of the class file that is to be loaded. The codebase parameter is optional, if present it could refer to a remote location for the servlet. The rest of the line in the first servlet tag refers to the init parameters for the servlet. A list of name-value pairs can also be specified for request parameters before the closing /servlet tag.

What does the Client see?

In the example presented above, the contents of the file up to the servlet tag would be sent to the client unmodifed. Then the DateServlet will be loaded from http://blitz and invoked with the appropriate init and request parameters. The output of the DateServlet is embedded into the response. The contents of the file after the ending servlet tag is then appended unmodified.

Files Searched for SSI

Only files with a "*.shtml" extension are searched for SSI tags. This is the default setting and can be changed using the JavaServer Administration. To connect to JavaServer Administration, type:
Top
java-server-feedback@java.sun.com