chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] url-encoded arguments et similia


From: Michele Simionato
Subject: Re: [Chicken-users] url-encoded arguments et similia
Date: Thu, 26 May 2005 03:15:14 -0400

On 5/26/05, felix winkelmann <address@hidden> wrote:
> That parameter is only bound in the "fallback-handler", that is, for special
> requests like .ssp pages.
> Here's a patch for spiffy.scm: <snip>

Cool! Please make it

 (parameterize ((current-urlencoded-arguments ,args) (current-request ,req))

so that post-var works too. Actually I like a lot this function, which
I have extracted from define-http-resource:

 (define (add-dynamic-resource url thunk)   
   (http:add-resource url
     (lambda (request args)
       (parameterize ((current-urlencoded-arguments args)
                      (current-request request))
       (let/cc return
         (let/ respond (http-resource:responder request return)
           (handle-exceptions exn
             (parameterize 
              ([http:error-response-handler (http-resource:error-handler exn)])
              (http:write-error-response 500 "Internal Server Error"))
            (respond (thunk)))))))))

Maybe it would be a good idea to expose it directly, would do you think?

             Michele Simionato




reply via email to

[Prev in Thread] Current Thread [Next in Thread]