
The way that WebSite, Windows CGI, and Java work together is a bit unusual. The diagram below should help you to understand how these three relate to each other.
The key to understanding how things work is to note that Java looks for its classes using its package naming convention and the CLASSPATH environment variable. For the time being, note that the WebSite Java example executables (.class files) are located in the WebSite\java\classes directory, and you must have included that directory in your runtime CLASSPATH (in the Registry).
During the WebSite Pro installation, we associated .clx with the WebSite Java launcher javaw.exe. To run a Java-based CGI program, you need to put a class proxy file into the cgi-win directory. The launcher uses the name of this file as the class name for Java to start. The proxy can be an empty file. It's extension is important only for the association that gets the launcher started. The name of the proxy is used by Java as the startup class name. Java uses the CLASSPATH to search for the corresponding .class file. Note that Java's naming is case-sensitive.
WebSite finds the class proxy and starts the launcher javaw.exe with the proxy's name as an argument, along with the full pathname to the Windows CGI profile (INI) file. The launcher strips the extension off of the proxy name and starts the Java interpreter in javai.dll with the CGI program's classname and some other arguments. The interpreter starts the CGI program through the WebSite.WinCGI class library. It's not important for you to know the details of this. Eventually the run() method in yout CGI program's main class is called and you're off to the races.
For a slightly more detailed description of this process, see Chapter 14, "WebSite & Java," in WebSite Professional Advanced Topics.
[email protected]