cfsetting
Description
Controls aspects of page processing, such as the output of HTML code in pages.
Categories
Related
History
ColdFusion
MX 6.1: Changed behavior: if the tag has a body, ColdFusion executes its
contents.
ColdFusion MX:
Added the requestTimeOut attribute.
The catchExceptionsByPattern attribute is
obsolete. It does not work, and causes an error, in releases later
than ColdFusion 5.
Changed exception handling: the structured exception manager
searches for the best-fit cfcatch handler. (In
earlier releases, an exception was handled by the first cfcatch block
that could handle an exception of its type.)
Syntax
<cfsetting
enableCFoutputOnly = "yes|no"
requestTimeOut = "value in seconds"
showDebugOutput = "yes|no" >
Note: You
can specify this tag’s attributes in an attributeCollection attribute
whose value is a structure. Specify the structure name in the attributeCollection attribute
and use the tag’s attribute names as structure keys.
Attributes
| Attribute | Description | Required | Default |
|---|---|---|---|
| enableCFoutputOnly | yes: blocks output of HTML that is outside cfoutput tags. no: displays HTML that is outside cfoutput tags. | Optional | |
| requestTimeout | integer; number of seconds. Time limit, after which ColdFusion processes the page as an unresponsive thread. Overrides the time-out set in the ColdFusion Administrator. | Optional | |
| showDebugOutput | yes: if debugging is enabled in the Administrator, displays debugging information. no: suppresses debugging information that would otherwise display at the end of the generated page. | Optional | yes |
Usage
The cfsetting requestTimeout attribute replaces the use of requestTimeOut within a URL. To enforce a page time-out, detect the URL variable and use code such as the following to change the page time-out:
<cfsetting RequestTimeout = "#URL.RequestTimeout#"> You can use this tag to manage whitespace in ColdFusion output pages.
If you nest cfsetting tags: to make HTML output visible, match each enableCFoutputOnly = "Yes" statement with an enableCFoutputOnly = "No" statement. For example, after five enableCFoutputOnly = "Yes" statements, to enable HTML output, you must have five corresponding enableCFoutputOnly = "No" statements.
If HTML output is enabled (no matter how many enableCFoutputOnly = "No" statements have been processed) the first enableCFoutputOnly = "Yes" statement blocks output.
If the debugging service is enabled and showDebugOutput =" Yes", the IsDebugMode function returns Yes; otherwise, No.
Note: Releases after ColdFusion MX allow a </cfsetting> end tag; however, this end tag does not affect processing. The cfsetting attributes affect code inside and outside the cfsetting tag body. ColdFusion MX ignored code between cfsetting start and end tags.
<cfsetting RequestTimeout = "#URL.RequestTimeout#"> You can use this tag to manage whitespace in ColdFusion output pages.
If you nest cfsetting tags: to make HTML output visible, match each enableCFoutputOnly = "Yes" statement with an enableCFoutputOnly = "No" statement. For example, after five enableCFoutputOnly = "Yes" statements, to enable HTML output, you must have five corresponding enableCFoutputOnly = "No" statements.
If HTML output is enabled (no matter how many enableCFoutputOnly = "No" statements have been processed) the first enableCFoutputOnly = "Yes" statement blocks output.
If the debugging service is enabled and showDebugOutput =" Yes", the IsDebugMode function returns Yes; otherwise, No.
Note: Releases after ColdFusion MX allow a </cfsetting> end tag; however, this end tag does not affect processing. The cfsetting attributes affect code inside and outside the cfsetting tag body. ColdFusion MX ignored code between cfsetting start and end tags.
Example
CFSETTING is used to control the output of HTML code in ColdFusion pages.
This tag can be used to minimize the amount of generated whitespace.
<cfsetting enableCFoutputOnly = "Yes">
This text is not shown
<cfsetting enableCFoutputOnly = "No">
This text is shown
<cfsetting enableCFoutputOnly = "Yes">
<cfoutput>
Text within cfoutput is always shown
</cfoutput>
<cfsetting enableCFoutputOnly = "No">
<cfoutput>
Text within cfoutput is always shown
</cfoutput>