[racket] web server: how to read the current url?

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Wed Feb 5 16:46:03 EST 2014

I'm not sure what a "current url" would be, given that continuations
jump around the program and storing it would be mean you might have to
store everything about the request, which could be large if there is
data with it.

current-servlet-continuation-expiration-handler receives the request
(which contains request-uri) that expired. Is that all you want?

Jay


On Wed, Feb 5, 2014 at 9:26 AM, Janos Tobias Locsei <jtlocsei at cantab.net> wrote:
> Is there a way for a function in the web server to find out the current url?
>
> I'm using stateful servlets and I'd like to redirect to the start page of my
> app if the continuation expires, using something along the lines of
>
> (parameterize
>   ([current-servlet-continuation-expiration-handler
>     <send response that redirects to start of app>])
>   (send/suspend/dispatch ...))
>
> I was hoping that I could write the bit inside the <> as a general purpose
> function for all my apps, so that e.g. it would see that the current url is
>
> http://mydomain.com/myapp;(("k" . "(8 2 17927109)"))
>
> and then just strip back the url and redirect to
>
> http://mydomain.com/myapp
>
> Is that possible?
>
> Tobias
>
>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/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.