Resetting your page output Buffer

Updated , First Published by Pete Freitag

I just figured out a simple way of resetting the output stream in a coldfusion template using the JspWriter obtained from the PageContext:

You won't see any content above the line below.

<cfset GetPageContext().getOut().clearBuffer()>

But you will see this content down here.

Update 2025: here's a more standard way to do it in CFML:

<cfcontent reset="true">

The Fixinator Code Security Scanner for ColdFusion & CFML is an easy to use security tool that every CF developer can use. It can also easily integrate into CI for automatic scanning on every commit.

Comments