NeoWebScript™ Management

Using the Server-Subst handler

To configure the server-subst handler, go into the srm.conf file and uncomment the handler lines for server-subst. For example:

	AddType text/html .shtml
	AddHandler server-subst .shtml
Also, make sure mod_neoscript.o replaces the regular includes module when the webserver program is compiled.

This variation on NeoWebScripts™ changes to a more native method way of invoking Tcl. Quite simply, the requested file is loaded, and passed to the safe interpreter's subst command. The result is written out to the browser. All facilities normally in NeoWebScripts™ are available here. There are two major differences:

Note: this implementation does not HTML-decode the source before passing the file into Tcl. This may change in future releases.

The file can contain all of the usual sort of text and HTML directives.

Let's look at a simple webpage:


<! Sample NeoWebScript-tm Webpage using 
substitution -->

<title>Sample NeoWebScript Webpage</title>
<h1>Sample NeoWebScript-tm Webpage</h1>

This is a sample webpage containing embedded 
NeoWebScript-tm directives using substitution.
<P>
The current server time is
\[clock format \[clock seconds\]\]
<P>
Thanks for visiting!

In the above example, the Tcl commands (surrounded by the square brackets) will be replaced with the results of the command execution. Let's try it:

The current server time is [clock format [clock seconds]]

(If you don't see a time here then the MIME type for the server-subst hasn't been set.) Since the page executes as a single Tcl command, there are no continuity issues. The include_file, include_virtual, load_file, load_virtual, and html commands may not be used, and are removed from the interpreter to prevent accidental use. All values are output via command return values or variable substitution.

Unfortunately, CVS tags look like variable references to Tcl. If you have any web pages under CVS control, you may have to abandon your tags in the source file.


Color codes:
Brand new features
Features to be included in next release