Registering a WARequestHandler

Jupiter Jones <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <[email protected]>
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
_______________________________________________
seaside mailing list
[email protected]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.