# WASD Hypertext Services - Scripting Environment

## 9 - Java

> 9.1 - Requirements

[next] [previous] [contents] [full-page]

Java classes may be used to perform CGI scripting with WASD. They may be designed as standard CGI scripts (with the inevitable latency of the class loading) or as CGIplus scripts (with the attendant benefit of lower latency).

Note that Java scripts must always be mapped and executed using the CGIplus path, however some can behave as standard CGI scripts, exiting after responding to the request, while others can persist, responding to multiple requests (see 3 - CGIplus). The CGIplus path is always necessary as Java does not have direct access to a process' general environment, the traditional way of passing CGI variables, so the WASD implementation uses the CGIplus data stream to provide CGI information.

WASD provides a class to allow a relatively simple interface to the CGI environment for both GET and POST method scripts. This and a collection of demonstration scripts may be found in the HT_ROOT:[SRC.JAVA] directory.

Developed using the first-release JDK1.1 beta kit for OpenVMS Alpha V7.1.

###
9.1 - Requirements

- Ensure the Java class file type is mapped to the Java run-time in the HTTPD$CONFIG configuration file.

        [DclScriptRunTime]
        .CLASS  @CGI-BIN:[000000]JAVA.COM

- The following content types are configured, also in HTTPD$CONFIG.

        [AddType]
        .CLASS  application/octet-stream  -  Java class
        .JAVA  text/plain  -  Java source
        .JAR  application/octet-stream  -  Java archive
        .PROPERTIES  text/plain  -  Java properties

- The CGI-BIN logical includes the HT_ROOT:[JAVA] class directory in the server startup.

        $ JAVA_ROOT = F$TRNLNM("HT_ROOT") - ".]" + ".JAVA.]"
        $ DEFINE /SYSTEM /TRANSLATION=(CONCEALED) -
                 CGI-BIN 'EXE_ROOT','SCRIPT_LOCAL_ROOT', -
                 'SCRIPT_ROOT','JAVA_ROOT'

[next] [previous] [contents] [full-page]