Sun Java System Web Server 7.0 Administrator's Configuration File Reference


The external function passes a value to an external rewriting program and returns the result.

Each invocation of external results in a single newline-terminated line being written to the external rewriting program's stdin. For each line of input, the program must produce a single line of output. When developing an external rewriting program, it is important to avoid buffering stdout. In Perl, for example, $| = 1; should be used to disable buffering. Because the server expects the external rewriting program to produce one line of output for each line of input, the server can hang if the external rewriting program buffers its output.


external(program, value)


The expression function has the following arguments.

Table A–8 external Arguments




The program argument is the file name of an external rewriting program. Because program is executed using the operating system's default shell (/bin/sh on Unix/Linux) or the command interpreter (CMD.EXE on Windows), program should be an absolute path or the name of a program in the operating system's PATH. The server starts the external rewriting program on demand. A given server process never executes more than one instance of the program at a time.

Note –

The server may start multiple instances of a given external rewriting program when the server is running in multiprocess mode.


The value passed to the rewrite program. 


The following is an example of an external rewriting program, used to change the prefix /home/ to /u/:

$| = 1;
while (<STDIN>) {
    print $_;

In this example, the external expression function used to invoke is as follows:

NameTrans fn="rewrite" path="$(external('', $path))"