Hunsberger, Peter wrote:
This of course is possible. My question is if there should be a more generic and intelligent proxying of HttpServletResponse's set|addHeader() calls in the abstracted Environment. The "Vary:" header would be just one of the use cases.Take the Vary case: if I'm right, only one Vary header is allowed in a response, so now you simply don't know what's going to happen if you just "pipe" the set|addHeader calls to the real response object.
If such object was wrapped we could have a way, on Cocoon, to decide if and what header set. I'm still not sure that this is the way to go, but I start feeling that it might be worth a thought, expecially if we are to start implementing conditional requests.
It seems you've conceptually described the 80% of the solution that is easy: the wrapper just has to accumulate each addition in a map or similar. The interesting part (the 20% that takes 80% of the time) is walking these results... Does the spec have a BNF for the Vary header? If so, you know that -- in theory -- it is possible to build a state machine or some other grammar handler that can walk the map (even if it has to sort it into an intermediate tree).
Ciao,
--
Gianugo Rabellino
Pro-netics s.r.l.
http://www.pro-netics.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]