[racket] Do stateless servlets need continuation managers?

From: Doug Orleans (dougorleans at gmail.com)
Date: Thu Mar 10 18:24:48 EST 2011

When I try to run this simple servlet:

#lang web-server

(require web-server/servlet)
(provide interface-version start)
(define interface-version 'stateless)

(define (start request)
  (send/suspend/dispatch
   (lambda (k-url)
     (response/xexpr
      `(html (body (a ((href ,(k-url start))) "Hello!")))))))

I get this (very unhelpful) error in the browser:

Exception

The application raised an exception with the message:

No instance for id: 0

Stack trace:

continuation-store! at:
  line 31, column 2, in file /usr/racket/collects/web-server/managers/none.rkt
<unknown procedure> at:
  line 88, column 5, in file /usr/racket/collects/web-server/servlet/web.rkt

<unknown procedure> at:
  line 129, column 19, in file /usr/racket/collects/web-server/servlet/web.rkt
<unknown procedure> at:
  line 122, column 10, in file /usr/racket/collects/web-server/servlet/web.rkt

send/suspend/dispatch at:
  line 116, column 0, in file /usr/racket/collects/web-server/servlet/web.rkt
<unknown procedure> at:
  line 58, column 2, in file
/usr/racket/collects/web-server/dispatchers/dispatch-servlets.rkt

select-handler/no-breaks at:
  line 164, column 2, in file
/usr/racket/collects/racket/private/more-scheme.rkt
select-handler/no-breaks at:
  line 164, column 2, in file
/usr/racket/collects/racket/private/more-scheme.rkt

select-handler/no-breaks at:
  line 164, column 2, in file
/usr/racket/collects/racket/private/more-scheme.rkt
select-handler/no-breaks at:
  line 164, column 2, in file
/usr/racket/collects/racket/private/more-scheme.rkt

select-handler/no-breaks at:
  line 164, column 2, in file
/usr/racket/collects/racket/private/more-scheme.rkt
select-handler/no-breaks at:
  line 164, column 2, in file
/usr/racket/collects/racket/private/more-scheme.rkt

connection-loop at:
  line 74, column 2, in file
/usr/racket/collects/web-server/private/dispatch-server-unit.rkt

Do I need to define a continuation manager?  I thought that stateless
servlets didn't need them, since continuations were "managed" by the
client.  Or maybe I don't understand what "stateless" means here?

--dougorleans at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110310/11da79b4/attachment.html>

Posted on the users mailing list.