View comments | RSS feed

cfdump

Description

Outputs the elements, variables and values of most kinds of ColdFusion objects. Useful for debugging. You can display the contents of simple and complex variables, objects, components, user-defined functions, and other elements.

Category

Debugging tags, Variable manipulation tags

Syntax

<cfdump 
  var = #variable#
  expand = "Yes or No" 
  label = "text">

See also

cfcookie, cfparam, cfsavecontent, cfschedule, cfset, cfwddx

Attributes

Attribute Req/Opt Default Description
var
Required

Variable to display. Enclose a variable name in pound signs.
These kinds of variables yield meaningful cfdump displays:
  • array
  • CFC
  • Java object
  • simple
  • query
  • structure
  • UDF
  • wddx
  • xml
expand
Optional
Yes
  • Yes: In Internet Explorer and Mozilla, expands views
  • No: contracts expanded views
label
Optional

A string; header for the dump output.

Usage

The expand/contract display capability is useful when working with large structures, such as XML document objects, structures, and arrays.

To display a construct, use code such as the following, in which myDoc is a variable of type XmlDocument:

<cfif IsXmlDoc(mydoc) is "True">
  <cfdump var=#mydoc#>
</cfif>

The tag output is color-coded according to data type.

If a table cell is empty, this tag displays "[empty string]".

Example

This example shows how to use this tag to display a URL variable. URL variables contain parameters that are passed in a URL string in a page request.

<cfdump var="#URL#">

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6

Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.

Comments


Choopernickel said on Aug 22, 2003 at 11:45 AM :
BUG FOUND in cfdump tag:
When a CFC is dumped, the component path is displayed as a hyperlink. This hyperlink leads to:
http://{cgi.server_name}/CFIDE/componentutils/CFCExplorer.cfc?method=getcfcinhtml&name={component.path}

Note the case. On CFMX 6.1 for J2EE, the CFC Explorer has an all-lowercase filename. When installed on a *nix server, the component's cfdump hyperlink points to a page which does not exist.
halL said on Aug 26, 2003 at 6:49 AM :
ColdFusion bug report 53335 has been entered for this problem.
Alexander Bunkenburg said on Sep 17, 2003 at 4:12 AM :
cfdump crashes when given a graph such as:
a = StructNew();
a.link = StructNew();
a.link.back = a;
Please document or remove this dangerous limitation.
halL said on Sep 19, 2003 at 8:05 AM :
The example in the preceding comment uses a self-referential (recursive) structure.
When cfdump attempts to process the structure, it encounters an infinite recursion in the data and eventually reaches the stack limit.
No screen name said on Sep 6, 2004 at 9:27 AM :
When dumpung a CFC return variable that is a xml variable, we get the output with no formatting (if you include the style and script elements in the file before the cfdump is initiated it displays correctly.)
S.Wright said on Sep 26, 2004 at 5:12 PM :
<cfdump var="#cfcatch#"> no longer works properly.

<cfdump var="#cgi#"> no longer dumps non-standard HTTP headers.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/Tags-pt122.htm