[transplant some of the notes from new-dispatch-model dan**20030616152617] { hunk ./doc/handlers.html 15 -
Look at static-file-handler.lisp and redirect-handler.lisp for a -couple of examples. To see more complicated stuff, grab the -source for CLiki and poke -around in there. +
A dispatching handler calls authentication and authorization methods, +then dispatches on the sub-handler, then logs. hunk ./doc/handlers.html 18 +
The HTTP methods is a specialisable argument - it's not unusual to +do different things for GET and POST at the same url. + hunk ./doc/handlers.html 39 +
When a request comes in, the *root-handler*'s handle-request method +is invoked on it. *root-handler* is a dispatching-handler, so calls +whichever appropriate subhandler you've installed for the URL. If you +install more dispatching-handlers, the dispatch will happen again. + +
At each level of dispatch, another clause is pushed onto the request's +HANDLED-BY slot value. This is a list of lists + +
+((handler index) + (handler index) + ...) ++ +where index is the element after the last position in the urlstring +that was used for discrimination. + hunk ./doc/handlers.html 67 -
Look at static-file-handler.lisp and redirect-handler.lisp for a +couple of examples. To see more complicated stuff, grab the +source for CLiki and poke +around in there. }