On this page:
make
Version: 4.1.1

6.13 Serving Web Language Servlets

 (require web-server/dispatchers/dispatch-lang)

The web-server/dispatchers/dispatch-lang module defines a dispatcher constructor that runs servlets written in the Web Language.

(make

 

#:url->path url->path

 

 

 [

#:make-servlet-namespace make-servlet-namespace

 

 

 

#:responders-servlet-loading responders-servlet-loading

 

 

 

#:responders-servlet responders-servlet])

 

  dispatcher/c

  url->path : url->path?

  

make-servlet-namespace

 

:

 

make-servlet-namespace?

 

 

 

=

 

(make-make-servlet-namespace)

  

responders-servlet-loading

 

:

 

((url url?) (exn exn?) . -> . response?)

 

 

 

=

 

servlet-loading-responder

  

responders-servlet

 

:

 

((url url?) (exn exn?) . -> . response?)

 

 

 

=

 

servlet-error-responder

If the request URL contains a serialized continuation, then it is invoked with the request. Otherwise, url->path is used to resolve the URL to a path. The path is evaluated as a module, in a namespace constructed by make-servlet-namespace. If this fails then responders-servlet-loading is used to format a response with the exception. If it succeeds, then start export of the module is invoked. If there is an error when a servlet is invoked, then responders-servlet is used to format a response with the exception.