modify response buffer
Michael Platzer <[email protected]> Fri, 07 Dec 2007 12:23:19 +0100
| Newsgroups | gmane.comp.java.helma.general |
|---|---|
| Message-ID | <[email protected]> |
Hi list, I would like to overwrite the response buffer with a complete new string within onResponse. As has been suggested here [1], i should simply call res.reset. But this also reset all response headers, that i've already set. Is there a simple way to preserve them? Currently I write sthg like: var contentType = res.contentType; var charset = res.charset; var cache = res.cache; // FIXME: I need to preserve all existing headers // in particular cookies that are being set res.reset(); res.contentType = contentType; res.charset = charset; res.cache = cache; res.write(str); A method like res.setBuffer (like [2]) would come in handy for such a task. greets, michi [1] http://helma.org/pipermail/helma-dev/2007-January/003249.html [2] http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletResponse.html#resetBuffer()