[plt-scheme] url rewriting

From: Hans Oesterholt-Dijkema (hdnews at gawab.com)
Date: Wed Jun 20 16:50:23 EDT 2007

So, how can I install a new dispatcher?

--Hans


Jay McCarthy schreef:
> Yes, it is possible.
>
> Implement a custom dispatcher [1] that does the rewriting, then use
> your own dispatching sequencing and put the rewriting dispatcher at
> the start. Everything "will just work". Send me the code and I can
> then integrate it. Basically you want:
>
> ; make : (url? -> url?) (conn? req? -> void) -> (conn? req? -> void)
> (define (make url->url inner)
> (lambda (conn req)
>  (inner conn (update-request-url req (url->url (request-url req))))))
>
> Jay
>
> 1. See new documentation, in SVN after `mzscheme -mvt
> docs/doc-installer.ss' or online at:
>
> http://jay.teammccarthy.org/tmp/web-server-reference/dispatchers.html#(part%20dispatchers) 
>
>
> On 6/7/07, Hans Oesterholt-Dijkema <hdnews at gawab.com> wrote:
>> L.S.,
>>
>> Is it possible to implement url rewriting with the PLT Webserver?
>> I'd like to rewrite things like:
>>
>> http://x.y.z/somepage.html
>>
>> to
>>
>> http://x.y.z/servlets/program?page=somepage
>>
>> Preferably without seeing it at the outside; except when the servlet
>> really becomes "active",
>> i.e. is used in a continuation style fashion to handle forms.
>>
>> --Hans
>>
>> _________________________________________________
>>   For list-related administrative tasks:
>>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>
>
>



Posted on the users mailing list.