module JavaServlet: sig .. end
Support for Java servlets.
In order to compile a module as either a servlet or a servlet
listener, it is necessary to compile the module with the
-servlet k command-line switch, where
k designates
the kind of servlet or servlet listener. A servlet class will be
generated, with the name
pack.MImpl (where
M is the name of
the compiled module) where
pack can be set using the
-java-package pack command-line switch.
When compiling with the
-servlet k command-line switch, the
module has to be compatible with one of the module types of the
JavaServlet
module, the exact module type depending on the value of
k. The following table gives the module types for the
different applet kinds.
The various kinds of servlet.
parameter to -servlet |
module type |
generic |
Generic |
http |
HTTP |
context-listener |
ServletContextListener |
context-attribute-listener |
ServletContextAttributeListener |
session-listener |
HTTPSessionListener |
session-activation-listener |
HTTPSessionActivationListener |
session-attribute-listener |
HTTPSessionAttributeListener |
session-binding-listener |
HTTPSessionBindingListener |
session-id-listener |
HTTPSessionIdListener |
Generic servlets
module type Generic = sig .. end
The module type for servlets compiled with -servlet generic.
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 implementation for HTTP servlets.
Listeners
module type HTTPSessionListener = sig .. end
The module type for listeners compiled with -servlet session-listener.
module type HTTPSessionIdListener = sig .. end
The module type for listeners compiled with -servlet session-id-listener.