WebSite
Server-Side Java(tm) SDK
API User's Guide
Powered by Java

Robert B. Denny - Version 0.3 (experimental)
WebSite.WinCGI API Documentation
Back to overview

How the API is Organized

The WebSite Java API is organized and documented using the same style and conventions as the JDK 1.0 API. For generic information on how to use this documentation, see the JDK 1.0 API User's Guide.

Narrative Description of Classes

The WebSite Java CGI framework consists of 12 classes. All but one of the classes are static; they cannot be instantiated. The exceptions are (1) the FormFile class (objects of this type hold the filespecs and attributes of uploaded files), and (2) the enumeration classes (these are used to enumerate extra headers, form fields, etc).

The CGI class is an abstract class that defines the run() method, which you must implement as your program's entry point. It also contains the linkage between your Java CGI program and the CGI interface, in conjunction with the Startup. The Startup class is private to the framework, you never see it and cannot use anything in it.

The Server class contains information about the local server. This data doesn't change from request to request, except for the local server's host name, which may change if the server is multi-homed.

The Client class contains information about the client (browser) that submitted the request. This includes such information as the IP address of the client, the product and version of the client software, and other items.

The Request class encapsulates all of the information about the HTTP request itself, except form data (see the next paragraph). This includes the method, extra headers, URL, and many other items. If the request is a POST accompanied by form data, the Form class provides you with access to the data in the form. WebSite Pro's form decoder and the framework completely hide the details of form structure and encoding. You deal with form fields by their name as specified by the name parameters in the HTML that defines the form. If the form contains one or more TYPE=FILE fields, corresponding to uploaded files, the Form object's file-specific methods allow you to retrieve the files and their attributes. They are stored as FormFile objects.

The Response class contains methods for returning the response back to the client. The most often used method is Response.println(), which sends lines of text back to the client. Note that WebSite Pro's spooled CGI interface, and memory-mapped network I/O assure the highest level of efficiency even if you call Response.println() with many small strings.

The various enumeration classes are used to enumerate lists of information such as form fields and extra headers. See the API documentation for the Form and Request classes for their use.


[email protected]