[UP] Modules |
WDialog API for Objective Caml: Wd_run_jserv
Module Wd_run_jservmodule Wd_run_jserv:This module contains a customizable main program for application servers connected with the JSERV protocol val create_request_handler :
This function creates a request handler for a JSERV-based application
server. Use this function like in this example:
This main program creates a "forking server" that starts a new subprocess (up to 20) for every arriving request. This is currently the recommended mode. It sounds a bit like CGI, but is much faster because the subprocess is already initialized when it forks.
The application is accessible under the URL
Call the function
The argument
charset : determines the character set for the internal representation
of strings and for the generated HTML pages. (Note that the parsed
XML files can have character sets independent of this setting.)
The default is ISO-8859-1 .no_cache : If true : The CGI response contains header directives
preventing the browser (and all caches between server and browser)
from storing the response. This ensures that never a cache copy
is taken, and for many browsers, the history is no longer usable
(when hitting the "Back" button, the user only gets a message
that the data is expired, but not the old page).
The default is true .error_page : This function is called when an exception is caught.
It can generate an error page by writing a nicely formatted
message to the output channel. The default is a function that
outputs a simple error page.response_header : If set, this parameter is taken as the initial
HTTP response header while processing the request. If omitted,
the response header defaults to: The content type is text/html,
the character set as determined by charset , the caching header is
set according to no_cache . |