[Seaside] Registering a WARequestHandler
Jupiter Jones
jupiter.jones at mail.com
Tue Jan 31 20:47:18 UTC 2017
I’m having an issue registering a handler in Seaside 3.2 that I’m hoping someone will recognise.
In the test "WARegistryTest>>testUrlFor” a handler is registered with an instance of WARegistry by simply creating a WARegistry with "WARegistry new".
In my app I’m doing something like this:
updateRoot: anHtmlRoot
| handler |
super updateRoot: anHtmlRoot.
handler := MySubclassOfWARequestHandler on: self.
url := WACurrentRequestContext value registry
register: handler;
urlFor: handler.
…however "WACurrentRequestContext value registry” answers my WAApplication instance, which overrides #register: from WARegistry for registering sessions - not handlers.
So…
I tried copying the way WARegistry>>register: does the registration into my method:
updateRoot: anHtmlRoot
| handler |
super updateRoot: anHtmlRoot.
handler := MySubclassOfWARequestHandler on: self.
anHtmlRoot application cache
store:
(handler
setParent: anHtmlRoot application;
yourself).
url := WACurrentRequestContext value registry urlFor: handler.
Which appears to store the handler in the application cache (instance of WABulkReapingCache).
However, when I call "WACurrentRequestContext value registry urlFor: handler” it ends up calling “WABulkReapingCache(WAExpiringCache)>>keyAtValue:ifAbsent:” method which calls #shouldNotImplement
Can anyone see what I’ve done wrong, or know how to register an application handler?
Thanks in advance :)
Cheers,
J
More information about the seaside
mailing list