User Guide
42 CFML Language Reference
CFEXIT
CFEXIT can be used to:
• Abort the processing of the currently executing CFML custom tag.
• Exit the template within the currently executing CFML custom tag.
• Reexecute a section of code within the currently executing CFML custom tag.
Syntax <CFEXIT METHOD="method">
METHOD
Optional. Specifies one of the following:
• ExitTag (default) — Aborts processing of the currently executing CFML custom
tag.
• ExitTemplate — Exits the template of the currently executing CFML custom tag.
• Loop — Reexecutes the body of the currently executing CFML custom tag.
Usage If a CFEXIT tag is encountered outside the context of a custom tag, for example in the
base page or an included page, the tag acts exactly like CFABORT. CFEXIT can help
simplify error checking and validation logic in custom tags.
CFEXIT behaves differently depending on location and execution mode:
METHOD
attribute
Location of CFEXIT call Behavior
ExitTag Base template Terminate processing
Execution mode = Start Continue after end tag
Execution mode = End Continue after end tag
ExitTemplate Base template Terminate processing
Execution mode = Start Continue from first child in body
Execution mode = End Continue after end tag
Loop Base template Error
Execution mode = Start Error
Execution mode = End Continue from first child in body