
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
Содержание COLDFUSION 5-DEVELOPING
Страница 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Страница 58: ...38 Chapter 3 Querying a Database ...
Страница 134: ...114 Chapter 7 Updating Your Database ...
Страница 210: ...190 Chapter 10 Reusing Code ...
Страница 232: ...212 Chapter 11 Preventing and Handling Errors ...
Страница 238: ...218 Chapter 12 Using the Application Framework ...
Страница 262: ...242 Chapter 12 Using the Application Framework ...
Страница 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Страница 320: ...300 Chapter 15 Indexing and Searching Data ...
Страница 336: ...316 Chapter 16 Sending and Receiving E mail ...
Страница 374: ...354 Chapter 18 Interacting with Remote Servers ...