[plt-scheme] URL rewrite/dispatch in PLT Web server

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Mar 27 18:00:21 EDT 2007

On Mar 27, Jay McCarthy wrote:
> > I took a look at the source code. Seems like I need to edit them
> > to add a new dispatcher, as it is evident by looking at this file,
> > http://ja.soegaard.net/planet/html/collects/web-server/web-server-unit.ss
> > As you can see there is code `specific' to each of the available
> > dispatcher.
> You would need to make a new module like web-server-unit.ss with a
> different dispatch function, your new dispatcher would rewrite URLs
> before passing them to the standard dispatchers, then take any
> response generated by the standard stack and replace the URLs going
> out. The dispatcher API is straight-forward from the many examples
> in the dispatchers/ directory.

Rewriting responses seems like a bad idea.  My guess is that the OP
wanted to simply use servlets in a different location, which is
something that is sorely missing.  The whole thing with artifical
separation between data and code (like Apache's /cgi-bin) is something
that belongs in the not-too-dynamic-past.  These days, separating
scripts and passive content is a bad idea.

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.