CFML tags and attributes

The following table describes the tags and attributes in ColdFusion MX that differ from ColdFusion Server 5:

Tag

Status

Compatibility issue
For more information
cfapplet 

Changed
Can now be used outside the context of cfform.
See cfapplet in CFML Reference.
cfapplication 

Changed
Setting clientstorage = "registry" is obsolete in UNIX versions of ColdFusion MX.
See cfapplication in CFML Reference.
cfauthenticate, 
cfimpersonate
cfinternaladmin
security
cfnewinternal
adminsecurity 

Obsolete
ColdFusion MX is based on a completely different security model than ColdFusion 5.
See the chapter on application Security inDeveloping ColdFusion MX Applications with CFML.
cfcache 

Changed
The timeout attribute is deprecated in ColdFusion MX; it will be obsolete in later versions. Use timespan instead.
The new timespan attribute specifies a decimal number of days between when the page containing the cfcache tag is first cached, and when the cache contents are automatically flushed.
See cfcache in CFML Reference.
action="cache" now caches on both the server and client, and the cache and optimal values are equivalent.
A new action value, serverCache, caches pages on the server only. It is identical in function to the cache value in ColdFusion 5.
The directory and cacheDirectory attributes are now equivalent. You can use either attribute with any action. (In ColdFusion 5, you can only use directory with action="flush", and you use cacheDirectory with all other action values.)
The port and protocol values now default to the values used to initially access the page. In earlier releases, the port default was "80", and the protocol default was http.
action="flush" now correctly expires a cached page in the server, the client, or both locations.
The cfcache.map file now contains the template name and source timestamp.
cfcatch 

Changed
cfcatch.Message gets the current values every time an exception is thrown, and ColdFusion MX ignores any cfset assignment to a cfcatch member.
To remedy this, construct a new message or variable to make extensions to changes in cfcatch values.
See the section about CFCATCH variablesL in CFML Reference.
cfcatch.Message returns a different SQLState value for Type 4 database drivers; this affects the NativeErrorCode variable as well.
Can no longer use cfcatch to catch function validation errors; use the ColdFusion MX compiler instead.
cfcol, 
cftable 

Changed
If you use the cfcol header attribute without any text, and the cftable colheader attribute, then ColdFusion MX displays the header as true. ColdFusion 5 displays the header as TRUE.
See cfcol and cftable in CFML Reference.
cfcollection 

Changed
The action attribute is now optional, and its default value is list, a new value in ColdFusion MX.
See cfcollection in CFML Reference, and Working with Verity Tools.
Added an attribute called name, which is required when action = "list". The name attribute provides the name for the query results.
When you use cfcollection with action = "list" and name = "<query_results_name>", you retrieve a table with the properties for every Verity collection that is registered by ColdFusion or the K2 Server.
cfdirectory 

Changed
(Windows) No longer returns rows for '.' and '..' in the query results, but only subdirectories, like on UNIX.
If your application has code to skip these rows (for example, startrow="3"), you must change it.
See cfdirectory in CFML Reference.
(Windows) No longer supports sort="temporary", and it only supports sorting on the ReadOnly and Hidden attributes.
(UNIX) When action=list, cfdirectory only reports the ReadOnly and Hidden attributes.
cferror 

Changed
type="monitor" is obsolete in ColdFusion MX.
See cferror in CFML Reference.
cfform 

Changed
ColdFusion MX only uses the cfinput tag's checked attribute if the corresponding form field value is undefined. ColdFusion 5 used the checked attribute if the field was undefined, or if it was defined but not equal to any of the specified options.
For example, if you use a cfparam tag to default form.foo to "false" before the following cfinput tags, then neither of the options are checked. In ColdFusion 5, the "yes" option is checked.
<cfinput name="foo" type="radio" value="yes" checked>
<cfinput name="foo" type="checkbox" value="no"> 

See cfform in CFML Reference.
The enablecab attribute is deprecated in ColdFusion MX; it will be obsolete in later versions.
cfgraph,
cfgraphdata 

Deprecated
Will be obsolete in later versions of ColdFusion MX. These tags render differently than in ColdFusion 5. Use the new graphing tags instead: cfchart, cfchartdata, and cfchartseries.
See the chapter on charting and graphing data in Developing ColdFusion MX Applications with CFML.
cfhttp 

Changed
The cfhttp response headers in ColdFusion MX differ from those in ColdFusion 5, as follows:
  • Mixed Case (returned by the server without changes) in ColdFusion MX; uppercase in ColdFusion 5
  • Random order in ColdFusion MX; alphabetical order in ColdFusion 5
  • "Status Code: 200" is followed by "OK" in ColdFusion MX (returned by the server without changes), and by "SUCCESS" in ColdFusion 5
See cfhttp in CFML Reference.
The timeout attribute requires the Java Development Kit (JDK) version 1.4; otherwise, ColdFusion MX ignores this attribute.
cfindex 

Changed
You can use the cfindex tag with the query attribute and type="file" or type="path", for all actions that require information from the key attribute.
See cfindex in CFML Reference and "Using the cfindex tag in ColdFusion MX".
cfldap 

Changed
You can no longer sort cfldap query results on the client side using the sort attribute. The sort attribute triggers a server-side sort. If the LDAP server does not support server-side sorting, cfldap throws an error.
The sort order depends on the LDAP server; for example, iPlanet Directory Server 5.0, Novell 6.0 server, Oracle Internet Directory 9i, Microsoft Active Directory, and others might each sort differently.
To do client-side sorting on the cfldap query results, use the ColdFusion Query of Queries feature.
See cfldap in CFML Reference.
When action=query and dn is in the list of attributes, cfldap returns each Distinguished Name (DN) with a comma followed by a space. (In ColdFusion 5, cfldap did not return DNs in a consistent format.)
If you select the referral attribute, cfldap returns the name of the referred server before the results.
For example, if the referred server is server1.rnd.anytown.anycorp.com:123, the results could look as follows:  DN:ldap://server1.rnd.anytown.anycorp.com:123/uid=bparker, ou=People, dc=siroe, dc=com, dc=siroe, dc=co, CN:Barry Parker, OU:Product Development, People
cflog 

Changed
The thread, date, and time attributes are deprecated, and will be obsolete in later versions of ColdFusion MX. All of these attributes default to Yes. If you set any of these attribute values to No, ColdFusion MX throws a runtime exception.
See cflog in CFML Reference.
cfloop 

Changed
ColdFusion MX returns struct keys in the order that you create them. ColdFusion 5 returns struct keys in alphabetical order.
If you need sorted struct values or keys, use the StructSort() and StructKeySort() functions.
See cfloop in CFML Reference.
cfmail 

Changed
ColdFusion MX formats undeliverable mail differently than in ColdFusion 5. If you have any custom code that relies on this format, you must change it.
See cfmail in CFML Reference.
cfparam 

Changed
ColdFusion MX correctly disallows the assignment of complex data types (such as array, binary, query, and struct) to the client scope in this tag.
See cfparam in CFML Reference.
cfprocparam 

Changed
The maxrows attribute is obsolete in ColdFusion MX. If you have ref cursors in packages or stored procedures, use cfprocresult instead. This causes Datadirect JDBC to place the Oracle ref cursors into a result set. (Note: you cannot use this method with the Oracle ThinClient JDBC drivers.)
See cfprocparam and cfprocresult in CFML Reference.
The cfprocparam tag ignores the dbvarname attribute for all drivers. (ColdFusion 5 used it for Sybase, Oracle, and Informix native drivers.) ColdFusion MX is a JDBC client which does not support named parameter passing like the Sybase ctlib and Oracle oci libraries.
cfquery 

Changed
The cfquery tag disallows SQL reserved words as variable or column names in a Query of Queries, unless they are escaped. To escape a reserved word, enclose it in brackets; for example: select [COUNT] from myTable or
select [FROM] from popQuery
See cfquery in CFML Reference.
Measures the timeout value in seconds, instead of milliseconds as in ColdFusion 5. You must convert each timeout value from milliseconds to seconds.
cfquery, 
cfinsert,
cfgridupdate,
cfupdate,
cfstoredproc 

Changed
In ColdFusion MX, all values of the dbtype attribute are deprecated except for dbtype="query", and dbtype="dynamic" is obsolete.
This is because ColdFusion MX uses the data source services provided by the underlying J2EE server, which provides better scaling and connection support in most cases. However, it only supports passing in the username and password, which is insufficient to define a data source. ColdFusion 5 can do this because it uses Open Database Connectivity (ODBC) to establish a database connection.
To work around this, define a data source to connect to the database.
See cfquery, cfinsert, cfgridupdate, cfupdate, and cfstoredproc in CFML Reference, and the "Data Source Management" chapter of Administering ColdFusion MX.
The dbserver, dbname, connectstring, provider, and providerdsn attributes are obsolete in ColdFusion MX.
cfregistry 

Deprecated for UNIX
Registry operations will be obsolete in later UNIX versions of ColdFusion MX.
Changed
In Windows, you should not use cfregistry to read ColdFusion server settings-such as the mail root and information about Verity collections and scheduled tasks-because much of this information is no longer stored in the registry, or it is stored in a different location in the registry. The ColdFusion-related values that are stored in the registry are subject to change.
cfreport 

Changed
This tag no longer manages the data connection for a Crystal report. Passes datasource, username, and password attributes to the Crystal Reports server for it to manage the data connection directly.
See cfreport in CFML Reference.
cfservlet 

Deprecated
Will be obsolete in later versions of ColdFusion MX.
See cfservlet in CFML Reference.
In cfservlet tags, you can only call servlets that were created in JRun version 3.1 or earlier.
cfservletparam 

Deprecated
Will be obsolete in later versions of ColdFusion MX.
See cfservletparam in CFML Reference.
cfsetting 

Changed
The catchExceptionsByPattern attribute will be obsolete in later versions of ColdFusion MX. ColdFusion MX uses best-fit exception handling. You can no longer set catchExceptionsByPattern to No to use first-fit exception handling.
See cfsetting in CFML Reference.
cfswitch 

Changed
You can no longer have code inside a cfswitch tag that is not in a cfcase or cfdefaultcase tag. ColdFusion 5 erroneously ignores the code, whereas ColdFusion MX correctly throws a compiler error.
See cfswitch in CFML Reference.

The ColdFusion section of the Macromedia website contains the most current compatibility information. For more information, go to http://www.macromedia.com/coldfusion.

Comments