cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Severin Gehwolf <>
Subject Cocoon and content-negotiation
Date Thu, 29 Nov 2007 09:55:12 GMT

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:

| 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

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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message