[hunchentoot-devel] Why override the standard dispatcher?

Bryan Emrys bryan.emrys at gmail.com
Mon Sep 22 21:33:30 UTC 2008


Newbie question. Can anyone explain why people would want to override the
standard dispatcher? E.g. in
http://www.lispcast.com/files/episode3/reddit-lisp.lisp

(defclass handler ()
  ((url
    :initarg :url
    :accessor url
    :type string)
   (handler
    :initarg :handler
    :accessor handler)
   (name
    :initarg :name
    :accessor name
    :type symbol)))

(defvar *handlers* (make-hash-table))

(defun our-handler (request)
  (let ((handler (gethandler (hunchentoot:script-name request))))
    (when handler (handler handler))))

(setf hunchentoot:*dispatch-table* (list 'our-handler))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/tbnl-devel/attachments/20080922/23fcd3a4/attachment.html>


More information about the Tbnl-devel mailing list