HTML Document Implementation

The JadeHttp.dll library supports TCP/IP and Internet named pipe connections.

A Web-enabled application containing HTML documents opens a pipe and listens for input. When input is received, it is processed and a reply is sent to the Web browser. The application then continues to listen for input.

If a start-up form is defined for a Web-enabled application, it is assumed that the application will use JADE forms. If no start-up form is defined for a Web-enabled application, an HTML page is used.

When a request is received by an HTML document‑based application, the processRequest method is not called if it is the initial request where the home page is invoked (it is called when additional request is made on that document; for example, a link is clicked) or if the reference tag in the received data is _jadeReferencePage. If the reference tag in the received message is _jadeReferenceClass, the processRequest method is called. Alternatively, you can reimplement the updateValues method to set up the required property values for the HTML page.

If no HTML home page is defined for the application, the processing is as follows.

  1. When the application is started up, an Internet TCP/IP or named pipe connection is created and the application then listens asynchronously on that connection.

  2. When the input is received, it determines if it is the initial request. If it is the initial request, it determines the default home page.

    If the default home page is not specified in the application, an error message is formulated by using the Application::htmlPageNotFoundMessage method and this error is sent as the reply.

If a home page is found, the following processing occurs.

  1. A transient instance of the corresponding class for this page is created.

  2. The message reply is sent to the instance. This message calls the updateValues method.

    The reply method returns a string, which is then sent as the response to the request. The default implementation of this method calls the JadeHTMLClass class generateHTMLString method, which generates the HTML with the updated values from the transient instance.

    It also includes the _ jadeReferenceClass class name and the _ jadeDocumentName HTML document name as hidden fields in the string. In addition, the session id of the currentSession system variable is also included as a hidden field. If the page was defined as secure, all URLs on the HTML page are prefixed with https.

  3. The transient instance is deleted and the application goes back to waiting for input.

  4. If it is not the initial request, the _ jadeReferenceClass and _ jadeDocumentName values are extracted from the incoming string and a transient instance of this class is created.

The rest of the processing for HTML pages is the same as that for the home page, except that the JadeHTMLClass::processRequest method updates the property values of the instance from the request string.