User Guide

Creating the Application.cfm File 219
Creating the Application.cfm File
The special application-wide page called Application.cfm defines application-level
settings and functions such as:
Application name
Client state management options
Application and Session variable management options
Default variables
Application-specific custom error pages
Data sources
Default style settings
Exclusive locks
Other application-level constants
Naming the application
In ColdFusion, you define an application by giving it a name using the
cfapplication tag. By using the same application name in a cfapplication tag, you
define a set of pages as part of the same logical application.
Note
The value you set for the name attribute in cfapplication is limited to 64 characters.
To name the application:
1 Open ColdFusion Studio and create a new file.
2 Modify the file so that it appears as follows:
<!--- This example illustrates cfapplication --->
<!--- Name the application --->
<cfapplication NAME="SearchApp">
3 Save the file as Application.cfm in the root directory of your application
framework.
Setting application default variables and constants
It is often useful to set default variables and application-level constants in the
Application.cfm file. For example, you can designate:
A data source that you are using
A domain name
Style settings such as fonts or colors
Other important application-level variables