[racket] stateless servlets problem

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon Jan 3 09:02:49 EST 2011

Ya, this is the suggested way to do it.

Jay

2011/1/2 Stefan Schmiedl <s at xss.de>:
> On Sun, 2 Jan 2011 19:23:42 +0100
> Stefan Schmiedl <s at xss.de> wrote:
>
> For now I'm content with having a web server that can serve
>> static files, call functions to handle requests or dispatch to different
>> (kinds of) servlets. Not sure that having such a beast run in the wild
>> is such a great idea, though.
>>
>
> FWIW, would this solution be the "correct" way to implement this kind of thing?
> For suitable definitions of hello et al., of course.
>
>  (require (prefix-in ds: web-server/dispatchers/dispatch-sequencer)
>           (prefix-in df: web-server/dispatchers/dispatch-filter)
>           (prefix-in dl: web-server/dispatchers/dispatch-lift))
>
>  (define dispatch (ds:make
>                    (df:make #rx"^/a.rkt" (dl:make hello))
>                    (df:make #rx"^/servlets" (ds:make
>                                              (dispatch/servlet hello-servlet-start #:regexp #rx"a.rkt" #:stateless? #t)
>                                              (dispatch/servlet world-servlet-start #:regexp #rx"b.rkt" #:stateless? #f)))))
>
> Way more elegant than what I had before, and works without
> raising exceptions.
>
> Thanks,
> s.
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>



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

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


Posted on the users mailing list.