Elements of a ColdFusion application
269
This chapter does not provide information on how to use or develop a specific application
framework. However, it does discuss how an application’s directory structure affects the
application and how you can map the directory structure. For more information on mapping the
application framework, see
“Mapping an application” on page 270
.
Note:
For one example of an application framework, see “ColdFusion Methodologies for Content
Management,” available at www.macromedia.com/v1/handlers/index.cfm?ID=20750&method=full.
Application-level settings and functions
ColdFusion processes the following two pages, if they are available, every time it processes any
page in the application:
•
The Application.cfm page is processed before each page in the application.
•
The OnRequestEnd.cfm page is processed after each page in the application.
Note:
UNIX systems are case-sensitive. To ensure that your pages work on UNIX, always capitalize
the A in Application.cfm and the O, R, and E in OnRequestEnd.cfm.
The Application.cfm page provides a good place to define the application. It can contain the
cfapplication
tag that specifies the application name, and contains code that must be processed
for all pages in the application. This page defines application-level settings, functions, and
features.
Application-level features include page processing settings, default variables, data sources, style
settings, and other application-level constants, and application-specific custom error pages. When
defined and set on the Application.cfm page, they are available on all pages in the application.
ColdFusion applications can have application-level variables that are not in the Application scope.
For example, every page in an application might have a currentPage variable that identifies the
page. The Application.cfm page can set this variable in the Variables scope, so each page gets a
different, local value. Because every page in the application has the variable, it can be considered
to be an application-level variable, even though it is not an Application scope variable.
The OnRequestEnd.cfm page is used in fewer applications than the Application.cfm page. It lets
you provide common clean-up code that gets processed after all application pages.
For more information on the Application.cfm and OnRequestEnd.cfm pages, see
“Creating the
Application.cfm page” on page 272
. For information on placing these pages in the application
directory structure, see
“Mapping an application” on page 270
.
Note:
You can create a ColdFusion application without using Application.cfm or OnRequestEnd.cfm
pages. However, it is much easier to use the Application.cfm page than to have each page in the
application use a
cfapplication
tag and define common application elements.
Reusable application elements
ColdFusion provides a variety of reusable elements that you can use to provide commonly-used
functionality and extend CFML. These elements include the following:
•
User-defined functions (UDFs)
•
CFML custom tags
•
ColdFusion components
•
CFX (ColdFusion Extension) tags
•
Pages that you include using the
cfinclude
tag
Summary of Contents for COLDFUSION MX 61-DEVELOPING COLDFUSION MX
Page 1: ...Developing ColdFusion MX Applications...
Page 22: ...22 Contents...
Page 38: ......
Page 52: ...52 Chapter 2 Elements of CFML...
Page 162: ......
Page 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Page 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Page 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Page 266: ......
Page 314: ...314 Chapter 14 Handling Errors...
Page 344: ...344 Chapter 15 Using Persistent Data and Locking...
Page 349: ...About user security 349...
Page 357: ...Security scenarios 357...
Page 370: ...370 Chapter 16 Securing Applications...
Page 388: ...388 Chapter 17 Developing Globalized Applications...
Page 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Page 410: ......
Page 426: ...426 Chapter 19 Introduction to Databases and SQL...
Page 476: ...476 Chapter 22 Using Query of Queries...
Page 534: ...534 Chapter 24 Building a Search Interface...
Page 556: ...556 Chapter 25 Using Verity Search Expressions...
Page 558: ......
Page 582: ...582 Chapter 26 Retrieving and Formatting Data...
Page 668: ......
Page 734: ...734 Chapter 32 Using Web Services...
Page 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Page 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Page 788: ......