[Seaside-dev] filters initialization with request context?

Lukas Renggli renggli at gmail.com
Sat Mar 7 21:38:55 UTC 2009


> I'm making a filter to make the response to be solved inside a transaction and I
> need to tell this transactional filter of the session in which database it has
> to commit. The database is decided based on the subdomain of the request so it
> would be convenient and I don't think this is a rare case.

Normally you should be able to access the current request context when
the filter is initialized.

Another possibility would be to do it lazily the first time the filter
is called.

> I'm doing it by subclassifiying wasession and overriding responseForRequest:
> setting the database there (if is not already), but doing that from there every
> time feels kind of dumb.

It shouldn't be necessary to subclass WASession in Seaside 2.9 anymore.

Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the seaside-dev mailing list