Gianugo Rabellino wrote:

Vadim Gritsenko wrote:

3. I dare you to find a clean solution from the sitemap POV to express this kind of conditions. :-)




Ahem...
http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/java/org/apache/cocoon/selection/BrowserSelector.java?rev=1.7&content-type=text/vnd.viewcvs-markup

ObjectModelHelper.getResponse(objectModel).addHeader("Vary", "User-Agent");


Not quite what I meant. First, I'm not sure, from the HTTP specs, that you can have more than one Vary header, actually I think it's quite the opposite (but I might well be wrong), so an addHeader might be dangerous (well, a setHeader might be even worse...). Second (and more important): in order to build a consistent system these headers should be set not by the sitemap components directly but by Cocoon itself,

I beleive this is not possible, Cocoon itself simply will not know. Response can be generated using multiple things in many places, and thus it will vary based upon values of those things and only those places know what it was... Just an example:

* Browser selector allows to vary response based on browser,
* Host selector allows to vary response based on virtual host,
* XSP page can inject current username onto page, making it vary on "user" header,
...

And on top of all this, current ResourceReader for some reason also adds "Vary: Host" reader... Who knows why?


Vadim


and there should be a clean way to declarate in the sitemap what kind of headers you want to be sent (and no, using an Action would not be a clean way :-)).

Ciao,



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to