12.6 The Server Side Includes
In order to spare resources on clients and networks, Java applets can be executed on the server rather than downloaded and started at the client. Such programs are then referred to as servlets. Server-side includes (SSI) is a technology that a Java-enabled Web server (a Web server with a servlet engine) can use to convert a section of an HTML file into an alternative dynamic portion each time the document is sent to the client's browser (Parziale, et al. 2006).
This dynamic portion invokes an appropriate servlet and passes to it the parameters it needs. The replacement is performed at the server and it is completely transparent to the client. Pages that use this technology have the extension .shtml instead of .html (or .htm) (Parziale, et al. 2006).
One of the simplest examples you can do using SSI, is to create a text file and save it. Upload it to your server. Then create an HTML file and add the following:
#include virtual="myfile.txt"
You can use SSI to include the output from a CGI script in your page. To include a CGI script, abc.cgi, you may use standard SSI call (like for any other file):
#exec cgi="/cgi/abc.cgi"
12.6 The Server Side Includes
SSI can also be used to display information on your page which is preset by the server as date and time command as follows:
#echo var="DATE_LOCAL"
As you quote, SSI is a useful feature that lets you do quick tasks such as include the contents of an external file across multiple pages on your site, or access and display server specific information such as the current server time, visitor's IP address, etc.