[racket] stateless servlets problem

From: Stefan Schmiedl (s at xss.de)
Date: Sun Jan 2 05:20:45 EST 2011


I can't create a stateless servlet in racket 5.0.2 (gentoo amd64).

I _can_ create a stateful servlet with

  (define (default-lru-manager)
                      (lambda (request)
                        `(html (head (title "Page Has Expired."))
                               (body (p "Sorry, this page has expired. Please go back."))))
                      (* 16 1024 1024)))

  (define hello-servlet
    (make-v2.servlet (current-directory)

If I understand the docs correctly, the following code should then create
a stateless servlet

  (define world-servlet
    (make-stateless.servlet (current-directory)

as (default-lru-manager) was fulfilling the contract requirements in the
stateful case.

But when I run the buffer (Ctrl-T), I get the following error message:

   broke the contract 
    (-> manager? (-> (-> void) number?))
   on manager-create-instance; expected a procedure that accepts no mandatory arguments without any keywords, given: #<procedure:drscheme-exit-handler>

I also tried substituting the LRU-manager with (create-none-manager #f),
but this did not change the error message. I don't quite get where the
#<procedure:drscheme-exit-handler> comes from at all.

What am I doing wrong here?


Posted on the users mailing list.