[plt-scheme] help with stateless servlets

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon Jul 6 12:22:57 EDT 2009

Hi Holden,

You didn't do anything wrong. There was a bug in servlet-env. I've
fixed it in SVN and you should be able to get it in the nightly build
for tonight (or if you use SVN, just do that.) Also, we're having a
release soon so you can wait until then.

Jay

On Sat, Jul 4, 2009 at 8:59 PM, Holden Karau<holden at pigscanfly.ca> wrote:
> I'm having some difficulty creating/launching a stateless servlet
> When I run the following code I get back "procedure
> make-stateless.servlet: expects 4 arguments, given 3:
> #<path:/usr/lib/plt/collects/web-server/default-web-root/htdocs>
> #<stuffer> #<procedure:.../servlet-dispatch.ss:26:21>"
> yousseb.ss defines & exports start, manager & stuffer for good measure
> (although I already pass manager & stuffer in as paramaters to
> serve/servlet )
> I assume I've missed something completely obvious to make this work, what is it?
> #lang scheme
> (require "mypath.ss")
> (require web-server/servlet-env)
> (require web-server/configuration/responders)
> (require web-server/managers/lru)
> (require "youuseb.ss")
> (require web-server/stuffers/base64)
> (require web-server/stuffers)
> (require web-server/stuffers/hmac-sha1)
> (define exp  (lambda (req)
>    `(html (head (title "Expired"))
>           (body (h1 "Expired")
>                 (p "This URL has expired. "
>                    "Please return to the home page."
>                     "This is likely because of increased load. It shouldn't happen
> again." )))) )
> (define use 2)
> (define mystuffer
>   (stuffer-chain
>    serialize-stuffer
>    (md5-stuffer (build-path "/tmp/" ".urls"))))
>
> (define mymanager (make-threshold-LRU-manager exp       2524000000))
>
> (serve/servlet start
>               #:launch-browser? #f
>               #:quit? #f
>               #:file-not-found-responder (gen-file-not-found-responder
> (build-path "/usr/src/awesome/static" "404.html"))
>               #:log-file  "/usr/src/awesome/mylog4"
>               #:log-format 'extended
>               #:listen-ip #f
>               #:manager mymanager
>               #:port 8085
>               #:stuffer mystuffer
>               #:command-line? #t
>               #:extra-files-paths
>               (list (build-path mypath "static"))
>               #:servlet-path "/app/"
>               #:stateless? #t)
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.