Interceptor Output Buffer
Every interception point receives a unique request output buffer that can be used to elegantly produce output. Once the interception point is executed, the interceptor service will check to see if the output buffer has content, if it does it will advice to write the output to the ColdFusion output stream. This way, you can produce output very cleanly from your interception points, without adding any messy-encapsulation breaking output=true
tags to your interceptors. (BAD PRACTICE). This is an elegant solution that can work for both core and custom interception points.
Hint Each execution point will have its own clean buffer to work with. As each interception point has finalized execution, the output buffer is flushed, only if content exists.
Output Buffer Argument
Here are some examples using the buffer
argument:
Here are some common methods on the buffer object:
append( str )
Append strings to the bufferclear()
Clear the entire bufferlength()
Get size of the buffergetString()
Get the entire string in the buffergetBufferObject()
Get the actual java String Builder object
Last updated