Module JavaServlet

module JavaServlet: sig .. end
Support for Java servlets.

In order to produce a class to be used as either a servlet or a servlet listener, it is necessary to compile the module with one of the following command-line switches:

The compiled module has to abide (respectively) the following module type: When a module M is compiled with a command-line switch -servlet x, an additional class with name MImpl is produced. The MImpl class implements (or extends) the interface (or class) related to x. As an example, compiling with -servlet http with result in a class extending javax.servlet.http.HttpServlet.


Generic servlets

type generic = javax'servlet'GenericServlet java_instance 
Shorthand for the type of generic servlets.
type request = javax'servlet'ServletRequest java_instance 
Shorthand for the type of requests to generic servlets.
type response = javax'servlet'ServletResponse java_instance 
Shorthand for the type of responses to generic servlets.
module type Generic = sig .. end
The module type for servlets compiled with -servlet generic.
module Default_Generic: sig .. end
Default (i.e.

HTTP servlets

type http = javax'servlet'http'HttpServlet java_instance 
Shorthand for the type of HTTP servlets.
type http_request = javax'servlet'http'HttpServletRequest java_instance 
Shorthand for the type of requests to HTTP servlets.
type http_response = javax'servlet'http'HttpServletResponse java_instance 
Shorthand for the type of responses to HTTP servlets.
module type HTTP = sig .. end
The module type for servlets compiled with -servlet http.
val options : http_response ->
[ `DELETE | `GET | `HEAD | `OPTIONS | `POST | `PUT | `TRACE ] list -> unit
options resp l is an implementation of do_options _ _ _ resp where l is the list of methods supported by the servlet.
module Default_HTTP: sig .. end
Default (i.e.

Listeners

module type ServletContextListener = sig .. end
The module type for listeners compiled with -servlet context-listener.
module type ServletContextAttributeListener = sig .. end
The module type for listeners compiled with -servlet context-attribute-listener.
module type HTTPSessionListener = sig .. end
The module type for listeners compiled with -servlet session-listener.
module type HTTPSessionActivationListener = sig .. end
The module type for listeners compiled with -servlet session-activation-listener.
module type HTTPSessionAttributeListener = sig .. end
The module type for listeners compiled with -servlet session-attribute-listener.
module type HTTPSessionBindingListener = sig .. end
The module type for listeners compiled with -servlet session-binding-listener.
module type HTTPSessionIdListener = sig .. end
The module type for listeners compiled with -servlet session-id-listener.