[hunchentoot-devel] Issue with setting a dispatcher

Hey everyone, 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.* Note also that I tried to pass a list as an argument to :request-dispatcher but I got a very weird error as well *[2009-08-31 20:17:37 [ERROR]] The value (#<CLOSURE (LAMBDA #) {B229325}>) is not of type (OR FUNCTION SYMBOL). *I though that i should pass a list as a variable. Can you please tell me what I am doing wrong? Thanks in advance. Mackram Raydan Website: www.trailoflight.net "An invasion of armies can be resisted, but not an idea whose time has come." Victor Hugo

On Mon, Aug 31, 2009 at 20:14, Mackram Raydan<mackram@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

Thank you so much Hans for your quick reply, that makes so much sense now :). Mackram Raydan Website: www.trailoflight.net "An invasion of armies can be resisted, but not an idea whose time has come." Victor Hugo On Mon, Aug 31, 2009 at 9:58 PM, Hans Hübner <hans.huebner@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
On Mon, Aug 31, 2009 at 20:14, Mackram Raydan<mackram@gmail.com> wrote: 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
_______________________________________________ tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel

Hey just in case anyone interested i wrote a post explaining the solution at http://www.trailoflight.net/blog/?p=22 Mackram Raydan Website: www.trailoflight.net "An invasion of armies can be resisted, but not an idea whose time has come." Victor Hugo On Mon, Aug 31, 2009 at 10:05 PM, Mackram Raydan <mackram@gmail.com> wrote:
Thank you so much Hans for your quick reply, that makes so much sense now :).
Mackram Raydan
Website: www.trailoflight.net "An invasion of armies can be resisted, but not an idea whose time has come." Victor Hugo
On Mon, Aug 31, 2009 at 9:58 PM, Hans Hübner <hans.huebner@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
On Mon, Aug 31, 2009 at 20:14, Mackram Raydan<mackram@gmail.com> wrote: 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
_______________________________________________ tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel
participants (2)
-
Hans Hübner
-
Mackram Raydan