I'm looking for something like Response.Clear()
.
views:
80answers:
2
+7
A:
You can reset the output buffer using the cfcontent tag with the reset argument:
<cfcontent reset="true">
Edward M Smith
2010-09-13 18:06:43
This is the same functionality as `<cfset GetPageContext().getCFOutput().clear()>` but it is documented, supported, and as Edward points out in his comment on jfrobishow's answer, portable between CFML engines. This is the way to go.
Adam Tuttle
2010-09-13 21:00:39
There are issues with this one, too, though. CFHTMLHEAD, CFFORM javascript, and a few other things are stored in a different output buffer and are appended at the end of the request. CFCONTENT RESET won't clear the markup on this other buffer, so you end up still getting it output.
Edward M Smith
2010-09-13 21:30:44
+4
A:
This will clear the response body and prevent the output of buffered content -
<cfset GetPageContext().getCFOutput().clear()>
jfrobishow
2010-09-13 18:07:11
Be careful that using this may make your code non-portable from Adobe Coldfusion to Railo or OpenBluedragon.
Edward M Smith
2010-09-13 20:47:49
Agree, I didn't know about cfcontent. Edward's answer is better and will be compatible with other CF Engines.
jfrobishow
2010-09-14 15:19:44