  | | | Cocoon and content-negotiation | Cocoon and content-negotiation 2007-11-29 - By Severin Gehwolf
Back Hi!
I am new to cocoon and I am wondering if there is a "cocoon-way" of content-negotiation, similar to that of Apache2? The problem I am faced with is to select a particular XML file with the best-matching language extension according to users Accept-Language HTTP headers. Unfortunately, Apache2's language negotiation comes in after the request is dispached to Cocoon. We have the following simplified setup:
Request | | httpd (Apache2) | | | `-> mod_rewrite/mod_proxy | | | `-> Cocoon | | |<-- ------+
So for example:
The HTTP request
GET /index.html HTTP/1.1 Host: foo.tld Accept: text/html Accept-Language: en,de;q=0.7,*
should trigger Cocoon to generate 'index.xml.en' (<map:generate src="index.xml.en"/>).
Is there a way to achieve this with plain cocoon sitemaps (no custom Selector/external Java code)? As far as I know a hook would be to use the 'RegexpHeaderSelector'. However, I am not really convinced if this is the best approach for such an issue?! Any suggestions greatly appreciated. I have Cocoon v.2.1.10 here.
Thanks! Severin
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: users-unsubscribe@(protected) For additional commands, e-mail: users-help@(protected)
|
|
 |