In Adobe CF I used to be able to access the output buffer via GetPageContext().getCFOutput().getBuffer(), but navigating getPageContext() via Dump I can’t find any similar function. I’m sure it’s there somewhere, but I’m not seeing it. I need to access it so that I can do some final processing of the output, reset content, and send out the modified version.
I’m really not sure what you want to do exactly, and I try to avoid any of those high level functions if possible. E.g. resetting content is as easy as setting content reset = "true";? As I can see from the ACF stuff the .getBuffer() is a function of the class CharBuffer.
Maybe what you want to look at is getPageContext().getResponseStream()?
Thanks. getPageContext().getout().getCharBuffer().toString() is what I needed.
You are correct in that resetting the output via Content Reset=“true” is definitely the way to go for clearing the buffer, but I needed to get the content of the buffer before I cleared it as I need to do some post processing after the page is done and before it’s sent to the browser. More specifically, in my current project, I don’t know what JS libraries I should be including at the top of the page until I’m done with the page. There are a few ways to skin this cat, but the easiest one would be to get the output stream, manipulate it, reset the stream, and then send the new content out. The only caveat is that I can’t do CFFlush anywhere.