[hunchentoot-devel] Issue with setting a dispatcher

Hans Hübner hans.huebner at gmail.com
Mon Aug 31 18:58:18 UTC 2009


On Mon, Aug 31, 2009 at 20:14, Mackram Raydan<mackram at gmail.com> wrote:
> I have been trying to get a dispatcher to work with hunchentoot but I have
> been unable to do it at all. Specifically running the following line on the
> REPL (hunchentoot:start (make-instance 'hunchentoot:acceptor :port 4555
> :request-dispatcher (apply 'hunchentoot:create-prefix-dispatcher '("/"
> make-home-page)))) would result in an error appearing when i try to access
> the localhost:4555. The error I get is [2009-08-31 21:04:16 [ERROR]] Error
> while processing connection: The value MAKE-HOME-PAGE is not of type
> SEQUENCE.

Confusingly, the argument to :request-dispatcher is something
completely different from what create-prefix-dispatcher creates.  The
:request-dispatcher argument is only used when you do not want to use
the dispatcher/handler architecture of hunchentoot.  It is a function
designator for a function that is called for each request to be
handled.  This function needs to parse the request and call an
appropriate handler, in whatever fashion your architecture requires.
Contrasted to that, create-prefix-dispatcher is part of hunchentoot's
own dispatcher and handler architecture.  If you want to use that,
you'll not supply a :request-dispatcher argument when you create the
acceptor, as the default will do the right thing.

-Hans




More information about the Tbnl-devel mailing list