View comments | RSS feed

CFML tags and attributes

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

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 ColdFusion5.
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 ColdFusion5.
The directory and cacheDirectory attributes are now equivalent. You can use either attribute with any action. (In ColdFusion5, 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. ColdFusion5 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. ColdFusion5 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 ColdFusion5, 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 ColdFusion5. 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 ColdFusion5, as follows:
  • Mixed Case (returned by the server without changes) in ColdFusion MX; uppercase in ColdFusion5
  • Random order in ColdFusion MX; alphabetical order in ColdFusion5
  • "Status Code: 200" is followed by "OK" in ColdFusion MX (returned by the server without changes), and by "SUCCESS" in ColdFusion5
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 ColdFusion5, 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. ColdFusion5 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 ColdFusion5. 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. (ColdFusion5 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 ColdFusion5. 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. ColdFusion5 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. ColdFusion5 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.

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


michaschopman said on Sep 28, 2003 at 5:04 AM :
When using cfdirectory.datelastmodified, keep in mind it is not a date object but a string object. In Coldfusion 5 DateCompare, DateFormat, etc could be done directly on the datelastmodified attribute. With CF MX you need to use a ParseDateTime first to create a date object from it.
No screen name said on Oct 31, 2003 at 9:24 AM :
The cloop comment "ColdFusion MX returns struct keys in the order that you create them. ColdFusion 5 returns struct keys in alphabetical order." is incorrect.

I have found ColdFusion MX 6.1 returns the keys in no particular order and the MX 6.1 documentation states this in a number of places.
jladams97 said on Apr 12, 2005 at 9:18 AM :
I don't see where the MX 6.1 documentation says that using cfloop to loop over a query is done in no particular order. I see where it says "The StructKeyList and StructKeyArray functions do not return keys in any particular order. Use the ListSort or ArraySort functions to sort the results" but I don't see where it speaks to the issue of order when looping over a structure.

I haven't done extensive testing at this point, but my preliminary findings indicate that it is not true that looping over a structure or returning its keys with StructKeyList or StructKeyArray happens in no particular order. I have seen the same order used consistently on the same structure. However, what that order is I do not know--it isn't the order the keys went into the structure and it isn't alphabetic. But the point is that there does seem to be some method to the madness and so the claim that "no particular order" is used is incorrect. Of course, since we as CF developers don't know what that method is and further, since that method doesn't result in any kind of useful ordering of the keys, we have to treat the method like it is random anyway.

Josh
CmdrTomalak said on Nov 4, 2005 at 5:21 AM :
From ColdFusion MX on, Structs are an implementation of Java HashMaps, which do not guarantee to keep the order of the keys as they are designed for speedy forward lookup, not for ordered traversal.

As long as they are unchanged, it is probable that they will be traversed in the same order during their lifetime, but as you add or remove keys, that order will change more or less unpredictably.

 

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

Current page: http://livedocs.adobe.com/coldfusion/6/Migrating_ColdFusion_5_Applications/cf_migration_guide6.htm