[plt-scheme] servlet development, again

From: Daniel Silva (dansilva at lynx.dac.neu.edu)
Date: Mon Jan 26 22:34:05 EST 2004

Here is a sample servlet module that comes with the web-server:

(module a-module mzscheme
  (provide interface-version timeout start)
   
  (define interface-version 'v1)
   
  (define timeout +inf.0)
   
  ; start : request -> response
  (define (start initial-request)
    `(html (head (title "A Test Page"))
           (body ([bgcolor "white"])
                 (p "A simple module servlet works.")))))

You need to provide three things: timeout (a number), interface-version
(the symbol 'v1), and start (a function: request -> response)

Daniel

On Mon, 2004-01-26 at 18:03, David Van Horn wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> How are module servlets developed in DrScheme?  According to the 
> documentation, develop-servlet.ss should be used, but as far as I can tell 
> this file doesn't exist (this has come up on the list before, but I haven't 
> seen a response).
> 
> I thought that if I opened the module, added the servlet teachpack, pressed 
> execute and required the module, that then I could do (send/finish (start 
> initial-request)), but this won't work: "expand: unbound variable in module 
> in: request-bindings".  None of the request accessors are bound in the module. 
>   Requiring servlet.ss & servlet-helpers.ss are no help either.
> 
> Thanks,
> David



Posted on the users mailing list.