The WASD Java environment has only very recently been implemented (December 1997) ... so there may be a few wrinkles  :^(  Developed using the first-release JDK1.1 beta kit for OpenVMS Alpha V7.1.

Java Logo   

This directory provides some demonstration Java scripts. These are here only to provide examples on approaching scripting using this environment ... and of course to provide some skeletal code for use in real Java scripts.

Of course the demos. will only work if Java is installed on the server system!

The class that makes CGI support relatively easy is CGIplus.java (javadoc).

Setup information not yet included in the WASD documentation.

To enable Java scripting ensure the following (also check the HT_ROOT:[EXAMPLE] directory)

  • ".CLASS @CGI-BIN:[000000]JAVA.COM" is present against "[DclScriptRunTime]" parameter in the HTTPD$CONFIG configuration file.

  • The following content types are included against "[AddType]" in the HTTPD$CONFIG configuration file.
      .CLASS  application/octet-stream  -  Java class
      .JAVA  text/plain  -  Java source file
      .JAR  application/octet-stream  -  Java JAR
      .PROPERTIES  text/plain  -  Java properties
    

  • The CGI-BIN logical includes the HT_ROOT:[JAVA] directory. For example:
      $ JAVA_ROOT = F$TRNLNM("HT_ROOT") - ".]" + ".JAVA.]"
      $ DEFINE /SYSTEM /TRANSLATION=(CONCEALED) -
               CGI-BIN 'EXE_ROOT','SCRIPT_LOCAL_ROOT','SCRIPT_ROOT','JAVA_ROOT'
    

Digital's JDK documentation can usually be found in SYS$COMMON:[SYSHLP.JAVA]

Class files (essentially the executables) are located in the common HT_ROOT:[JAVA] directory (because, of course, they are architecture independent :^)

Note that all these scripts are executed using the CGIplus path, however some behave as standard CGI scripts, exiting after responding to the request, while the others persist, responding to multiple requests. The CGIplus path is necessary however as all use the CGIplus variable data stream to retrieve the CGI variables.

Directory Contents
Standard CGICGIplus Source CodeComment
CGIplus.java
javadoc
A generic class that allows Java scripts to be used in WASD's environment. The demonstration scripts all use this class.
[demo 1]
[demo 2]
[demo 3]
dumpCGI.java Simple CGI script to dump the CGI name and value pairs read from the CGIplus data stream.
[demo] [demo] hi1CGI.java
hi1CGIplus.java
Simple CGI and CGIplus scripts.
[demo] [demo] hi2CGI.java
hi2CGIplus.java
Simple CGI and CGI plus scripts providing HTML.
[GET demo]
[GET demo]
postCGI.java
postCGIplus.java
CGI and CGIplus scripts capable of processing GET requests and POSTed URL-encoded forms.