[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 +

Handler invocation

+ +

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 -

Authentication and authorization

+

Authentication and authorization methods

hunk ./doc/handlers.html 73 -Typically, we arrange that the authentication handler is responsible +Typically, we arrange that the authentication method is responsible hunk ./doc/handlers.html 80 -The authorization handler has to check if the requested action is allowed +The authorization method has to check if the requested action is allowed hunk ./doc/handlers.html 139 +

Examples

+ +

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. }