[email protected] writes:
> Interestingly when my pages are added to the end of the *dispatch-
> table* list they don't work but when added at the start of the list
> they do.
Using handler lists means that *order matters*, much as the
class-precedence-list order always matters for method dispatch. And
furthermore, as all Hunchentoot can see is a list of functions, it has
no way of "doing what you mean".
For example, let's pretend that the Hunchentoot dispatcher list looked
like this:
((("foo") . show-foo)
(("bar") . show-bar)
(("foo" "hapless") . show-foo-hapless))
Where you intend for /foo or /foo/1 or /foo/hello to invoke show-foo,
/bar/* to invoke show-bar, and specifically /foo/hapless/* to invoke
show-foo-hapless. Because Hunchentoot can see the details of your
prefixes, it can sort the dispatchers longest-first so that
show-foo-hapless gets to handle /foo/hapless/baz instead of show-foo.
However, if the list looks like this instead:
(show-foo show-bar show-foo-hapless)
then the prefix matcher inside `show-foo' will capture it. Of course,
the reason Hunchentoot uses the latter is that any published matching
scheme would be limited by its publication; you would preclude or
override any different criteria Hunchentoot users might like to use.
Even using an alterable list of functions instead of a straight function
has the side effect of making it so that *order matters*.
> I'm really new to Weblocks anyway but do these dispatchers always
> clash? Is there an example or workaround to get this working?
In other words, since you're playing with dispatchers yourself, you
should familiarize yourself with Weblocks's own dispatchers. We have
two. Look at src/server.lisp.
(Hint: is your webapp's prefix ""?)
--
You know...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---