Welcome to Macromedia ColdFusion® MX, the rapid server scripting environment for creating rich Internet applications.
ColdFusion MX brings the proven ease of use and productivity of ColdFusion to the highly scalable, standards-based Java technology architecture. ColdFusion MX offers innovations for creating rich Internet applications and working with XML, web services, and the Microsoft .NET Framework.Some of the more exciting new features in ColdFusion MX include:
While frequently cited, these are certainly not the only new features or enhancements to existing features in the product. This document provides a look at these and many of the lesser-known features of ColdFusion MX.
For an element-by-element overview of changes to the CFML language, click here.
Feature | Description |
---|---|
ColdFusion Components | Using the revolutionary new ColdFusion Components capability of ColdFusion MX, you can easily encapsulate and reuse code to create well-structured applications that can be automatically accessed as web services or as remote services for Macromedia Flash clients using the integrated Macromedia Flash Remoting service. |
XML Support | Applications can integrate with XML just like any other
data source using built-in document parsing, XSL transformations, and automated
serialization of data into XML.
ColdFusion MX treats XML as a CFML data type, using concepts and syntax familiar to anyone who has used ColdFusion arrays and structs. XML documents can now be easily imported, queried, transformed, modified and manipulated in ColdFusion MX applications. In addition, a CFXML tag has been added, used to create entire XML documents in an innovative manner. Also, CFDUMP can now be used in conjunction with XML document trees and their elements (similar to dumping a structure). |
Native Flash Connectivity |
Included as a native service within ColdFusion MX, Macromedia Flash Remoting enables ColdFusion developers to easily deliver remote services to Macromedia Flash clients. Using ColdFusion Components or the new support for server-side ActionScript, developers familiar with ColdFusion or Macromedia Flash can easily create applications that combine the responsiveness and functionality of client/server applications with the reach and low cost deployment of the Internet. |
Web Services |
Invoke web services from your applications with a single line of code or publish your own using ColdFusion Components and a standards-based web services engine. |
Feature | Description |
---|---|
Hosting Security | Secure shared hosting environments now have more control over resources that can be locked. Administration of sandboxes has been simplified. Sandbox administration also no longer requires a server restart after modifications are made. |
Simplified Locking | Speed up high volume applications with shared variable locking
and simplified locking configuration with shared in-memory variables.
All scopes are internally synchronized, so you no longer need to use locking to ensure system stability as in previous versions of ColdFusion. You do, however, need locking for race condition situations. For example, if you want to say App.Foo = App.Foo + 1, you should lock it so that no other process runs the code at the same time. |
Verity Improvements | Take advantage of some of the new Verity search engine enhancements
in ColdFusion MX. Overview of enhancements:
The query table has the following columns:
IsK2ServerOnline() |
Feature | Description |
---|---|
Internationalization |
Build applications that support character-based languages
such as Chinese, Japanese, or Korean with support for UNICODE encodings.
Locale-specific functions produce the same results across platforms, using the Java standard locales. Also, a new function, setEncoding(scope, encoding) has been added: It
sets the character encoding of input Form and URL scope variable values;
used when the character encoding of input is anything other than Latin-1. |
JSP/Servlet Support | Create hybrid Internet applications that combine ColdFusion
pages, Java Server Pages, and servlets by leveraging the built-in servlet
engine.
|
JSP Tag Library Importing via CFIMPORT |
Call JSPs or servlets directly from within a CFML page or
import JSP tag libraries and use them just like ColdFusion custom tags using
the new CFIMPORT tag. The CFIMPORT tag lets you import a JSP tag library into a ColdFusion page. Once imported, you reference the JSP tags using <prefix:tagname> syntax. You set the prefix in the CFIMPORT tag. To use JSP custom tags in your ColdFusion pages, follow these steps: 1. Place your JSP tag library JAR file, such as myjsptags.jar, into the
wwwroot/WEB-INF/lib directory.\ <CFIMPORT prefix="mytags" taglib="/WEB-INF/lib/myjsptags.jar"> The JSP tag library is now available to use in your CFM page. To reference a JSP tag from this jar file, use the following syntax: <CFOUTPUT> Note: You must insert the CFIMPORT tag at the top of every page
that uses tags from the JSP tag library. Placing CFIMPORT into application.cfm
or in an included page does not propagate the import. |
Enhanced Java Integration | CFOBJECT is now faster, more reliable, and more flexible!
ColdFusion MX provides simplified access to Java objects with native Java
connectivity. The support for using Java objects in ColdFusion applications has been considerably improved in ColdFusion MX. ColdFusion 5 was not built on a Java foundation, and therefore did not treat Java objects in a native manner. ColdFusion MX, on the other hand, does treat Java objects natively, offering better performance, some new enhancements, and better stability. A few examples:
|
Integrate with .NET | Integrate your application with existing Microsoft applications or new applications using the web services support in ColdFusion MX for the .NET Framework. |
Mail Enhancements |
Spooling of mail can be turned off, allowing mail to be run on a memory queue. This allows mail to be sent faster. The mail implementation in ColdFusion MX also uses the java.mail API, ensuring full standards compliance. |
Accessibility | Easily build Section 508-compliant web sites by creating
reusable accessibility templates or leveraging a 508-compliant ColdFusion
administrator.
An increasingly common requirement for development projects is compliance
with Section 508 guidelines. The ColdFusion Administrator is 508-compliant,
allowing you to more easily create 508-compliant ColdFusion projects. |
Feature | Description |
---|---|
Multiple Custom Tag Paths | Organize your custom tags with ColdFusion MX!
You can now specify multiple custom tag paths in a ColdFusion application. ColdFusion MX now allows you to do this using the CFIMPORT tag. To import a custom tag directory, use the command: <CFIMPORT prefix="prefix" taglib="/directoryname"> at the top of your calling template to gain access to all of the tags in the directory. To call a custom tag located in this directory, you use syntax <prefix:tag name attr1=val1 attr2=val2 ... > Example: To import these tags for use in your application, you use the following
at the top of your calling template: To call your dostuff tag, you simply call: When using CFIMPORT, you don't use "cf_" as the prefix, you use "prefix:". Note: The CFIMPORT statement must be declared on the page where
you use the custom tags. |
Code Compatibility Analyzer | Simplify migration from a previous release by automatically
identifying deprecated tags and other issues in existing CFML pages. You
can access the Code Compatibility Analyzer from the ColdFusion Administrator.
Try running your existing applications through it to detect any possible
incompatibilities with ColdFusion MX. You should read the Migrating ColdFusion
Applications documentation for information on migrating your applications
from ColdFusion 5 to ColdFusion MX. |
Integrated Development Web Server |
Get your development project started more easily using the
bundled ColdFusion MX HTTP server.
ColdFusion MX includes its own web server that you can use to develop ColdFusion MX applications without depending on an external Web server, such Internet Information Services, Apache, or iPlanet. While Macromedia does not recommend using the ColdFusion MX web server in production environments, it more than meets the need for a development Web server. |
Improved Charting and Graphing | ColdFusion MX allows graphing of multiple data sets, offline
batch graph generation, more chart formats than ColdFusion 5, advanced data
formatting options and much more. New tags include CFCHART, CFCHARTSERIES,
and CFCHARTDATA. Note: The CFGRAPH tag has been deprecated in ColdFusion
MX. This means that the functionality will still work in this release
of ColdFusion MX, but the CFGRAPH tag will not be supported in future
releases. Some existing CFGRAPH attributes are not used by ColdFusion
MX. We strongly recommend that developers use the new CFCHART, CFCHARTSERIES,
and CFCHARTDATA tags for all charting. |
Improved Regular Expressions | Simplify string parsing and manipulation with new Perl-compatible
regular expressions. Many types of regular expression technologies are available to programmers. JavaScript, Perl, and POSIX are all examples of different regular expression technologies. Each technology has its own syntax specifications and are not necessarily compatible. ColdFusion supports regular expressions that are Perl compliant with a few exceptions:
|
Improved Exception Handling | Create more reliable applications with expanded exception
handling. CFScript provides two statements for exception handling: try and catch. These statements are equivalent to the CFML CFTRY and CFCATCH tags. |
Expanded Debugging and Tracing with CFTRACE | Rapidly debug your application code with customizable tracing,
enhanced error messages, and better output organization. |
Roles-Based Security | Secure your applications quickly using the new role-based security model that offers a flexible framework for security in your applications. Users can be authenticated and authorized against any ColdFusion data source, including Active Directory, LDAP servers, and relational databases. |
Query of Queries Enhancements | ColdFusion MX builds on the query of queries support introduced
in ColdFusion 5. All of the new features are SQL-compliant, except alias
support. ColdFusion MX supports the following alias substitutions: ORDER BY clause: GROUP BY clause: HAVING clause: Like ColdFusion 5, ColdFusion MX does not support aliases for table names. ColdFusion MX throws a syntax error exception, whereas ColdFusion silently produces an incorrect result set. ColdFusion MX supports arbitrary expressions to be grouped ColdFusion 5 only supports simple column references. Arbitrary expressions in aggregate functions ColdFusion MX supports aggregate functions of any arbitrary expression. ColdFusion 5 only supports simple column reference aggregates. Example: select lorange, count(lorange+hirange) from A group by lorange The select statement correctly executes in ColdFusion MX. ColdFusion 5 produces only the lorange column, excluding the count column. Aggregate functions in arbitraty expressions ColdFusion MX supports arithmetic expression that includes aggregate functions. ColdFusion 5 does not support aggregate functions in arithmetic expressions. Example: select MIN(lorange) + MAX(hirange) A group by lorange LIKE conditional ColdFusion MX supports the following syntax: LIKE pattern [ESCAPE 'escape_char'] Case insensitive matching While both ColdFusion 5 and ColdFusion MX perform case-sensitive matching on strings, ColdFusion MX supports two additional string functions, UPPER() and LOWER(), that can be be used for case insensitive matching. Adding and subtracting DATE types ColdFusion MX supports adding and subtracting date types. Performance of Query of Queries has also been significantly improved. |
User Defined Functions authored with CFML Tags | Create User Defined Functions using the new CFFUNCTION tag!
You no longer need to use CFSCRIPT to define functions. Define a function: <CFFUNCTION name="getEmployeesNames" > Call it later: <CFSET employees = getEmployeesNames()> |
CFCACHE Improvements |
CFCACHE is an easy way to achieve major performance gains
for qualifying pages. If a page does not change for some period of time,
CFCACHE can reduce server load and page load time, often dramatically. Simply
place <CFCACHE timespan="n"> at the top of the page template,
where n is the number of days until the cache should be "flushed",
i.e. disposed of and a new one created. You may use #createTimeSpan()# in
place of n if you prefer.
attribute "action" (optional): Cache (default): Caches page on server and client. attribute "directory" (optional): Fully qualified path of the directory where the cache files are stored. Default is the base template directory. (Also known as CacheDirectory.) attributes username, password, port, protocol: optional settings for http call to cached content. username & password: If the page requires authentication at the web
server level. Changes will not appear on cached pages until the cache is flushed. Thus, by default, there will be a delay of up to timespan until content changes appear. However, you can eliminate this delay by "manually" flushing the page after a change using action="flush". In the code where the content change happens, such as a database insert, add a <CFCACHE action="flush" directory="d"> where d is the abovementioned directory. If there are multiple pages cached in the directory, you can specify exactly the ones you want to flush with expireURL. CFCACHE considers each unique URL to be a separate "page" -- e.g. http://mysite.com/view.cfm?id=1 and http://mysite.com/view.cfm?id=2 are two different pages. Personalized pages: By default CFCACHE caches one version of the page for all to see, which is not compatible with personalized other otherwise client/session-dependent pages. However, you may consider using action="ClientCache" for personalized pages. This mode offers only partial caching benefits, but it is compatible with personalized pages. Secured pages: When a new cache needs to be generated, CFCACHE uses a self-referential CFHTTP call to capture the contents of the URL. If the page is secured at the web server level, add the username & password attributes to specify a valid login for the http request. If the page is secured at the ColdFusion level, such as with CFLOGIN and Sandbox Security, you can specify passSession=true to utilize the current user's authentication to access the page (i.e. the user who happened to have browsed the page when the cache needed to be generated). However, if the page contains personalized content, be sure to heed the above instructions about using action="ClientCache", lest you cache one user's version of the page for all to see. Compatibility: In ColdFusion 5 the default "Cache" action only cached pages
on the server. Now it also caches on the client. Theoretically client
caching should be desirable whenever server caching is desirable, so this
should be backward compatabile. However we still provide a "ServerCache"
option, corresponding to the old "Cache" option, in the event
that the developer intentionally wants only server caching. |
Smart Structs | You can use a dot operator to automatically generate a struct
and specify a struct member.
Example: <CFSET x=StructNew()> This would throw an error in ColdFusion 5. In ColdFusion MX, this creates the intermediate structs "x.a" and "x.a.b" automatically. |
Feature | Description |
---|---|
ExpandPath() | ExpandPath() now works with absolute paths |
Java Methods | You can call Java methods that are overloaded and have the same number of arguments in ColdFusion MX |
CFSETTING | <cfsetting enablecfoutputonly> ... </cfsetting> can now nest. |
CFAPPLICATION | The CFAPPLICATION NAME attribute is now optional. If not included, it provides access to the J2EE application and session scopes. |
Server Probes | Server Probes are now easier to configure and have been more logically arranged in the ColdFusion Administrator. |
exp() | exp(0) = 1 instead of throwing an error like ColdFusion 5 |
Power of Zero | anynumber ^ 0 = 1 instead of an error like ColdFusion 5 |
UNICODE Programming Elements | CFML programming elements can be unicode. Includes variable names string constants, etc. <CF_(unicode name)> is valid cfml. |
evaluate() Performance | Evaluate() is much faster when the expression is just a variable reference. |
Improved Date Functions | ColdFusion MX date functions work with the Java calendar class, which is historically accurate back to circa 2000 BC (Cesarian & Gregorian calendars). ColdFusion 5 only guaranteed correctness back to the year 1900. |
numberformat() | numberformat() with a number that is too big no longer causes system problems. |
Query Cells | ColdFusion MX query cells can now contain any value, simple or complex. |
ToString(), ToBase64() | ToString and ToBase64() now take a second arg to specify
encoding when converting binary values and string values. |
This section lists the CFML tags and functions that have been added or changed in ColdFusion MX. For details, see the Migrating ColdFusion 5 Applications guide and the CFML Reference.
Tag/Function |
Status |
CFCOLLECTION |
Changed:
new name attribute and action=list |
CFLDAP |
Changed:
sort attribute deprecated |
CFLOG |
Changed:
thread, date, and time attributes are deprecated |
CFLOOP |
Changed:
setting collection to a struct in cfloop is deprecated. Use structsort()
instead |
CFIMPORT |
New:
Java Interopability: Used to import JSP tag libraries |
CFTRACE |
New:
Debugging: Helps developers debug applications. |
CFXML |
New:
XML: Used to dynamically create XML documents using CFML |
CFINVOKE |
New:
Components and Web Services: Executes a method on a component or Web
Service |
CFCOMPONENT |
New:
Components: Used to define a component |
CFPROPERTY |
New:
Components: Used to define a property of a component |
CFFUNCTION |
New:
UDFs, Components: Create a User Defined Function via a tag or define
a function in a CFC |
CFARGUMENT |
New:
UDFs, Components: Defines an argument in a tag based User Defined Function
or a CFC function |
CFRETURN |
New:
UDFs, Components: Returns a value from a tag based User Defined Function
or CFC function |
CFLOGIN |
New:
User Security: Defines the block of code where user authentication is
performed |
CFLOGINUSER |
New:
User Security: Used to indicate that a user has been authenticated in
an application |
CFLOGOUT |
New:
User Security: Used to indicate that a user is no longer authenticated
and must re-login |
CFCHART |
New:
Charting: Create a graph |
CFCHARTDATA |
New:
Charting: Specifies data for an individual data point |
CFCHARTSERIES |
New:
Charting: Specifies a series of data for a chart |
createObject() |
Changed:
Can now also be used for web services and ColdFusion components |
isObject() |
New:
Used to query type |
getMetaData() |
New:
Returns meta-data about an object |
isXmlDoc() |
New:
XML: Used to query type |
xmlNew() |
New:
XML: Create a new CFML XML object (the XML equiv. of StructNew() ) |
xmlParse() |
New:
XML: Parse an XML document into a CFML XML object |
xmlTransform() |
New:
XML: Perform a XSLT transformation |
xmlSearch() |
New:
XML: Perform an XPATH query on XML |
xmlElemNew() |
New:
XML: Create a new XML node element |
isXmlElem() |
New:
XML: Used to query type |
isXmlRoot() |
New:
XML: Used to query type |
xmlChildPos() |
New:
XML: Searches for the location of a child node |
setEncoding() |
New:
internationalization: Sets the character encoding of input Form and
URL scope variable values; used when the character encoding of input
is anything other than Latin-1. |
getAuthUser() |
New:
User Security: Returns the name of the current logged in user |
isUserInRole() |
New:
User Security: Conditional function used to determine if a logged in
user is in a role |
The following tags are deprecated* in ColdFusion MX:
* Deprecated means that ColdFusion MX will support the use of these tags, but Macromedia does not intend to support these tags in future releases. You should look for alternatives to these tags and functions.
The dbname and dbserver parameters present in some ColdFusion 5 CFML tags such as CFQUERY are not supported in ColdFusion MX and will cause a syntax error.
ColdFusion MX no longer supports the following tags and functions:
See the documentation "Migrating ColdFusion 5 Applications" for complete details on deprecated and non-supported tags and functions.