User Guide

Table Of Contents
296 Chapter 13: Designing and Optimizing a ColdFusion Application
Defining page processing settings
The
cfsetting tag lets you specify page processing attributes that you might want to apply to all
pages in your application. For more information, see “Setting page processing options
on page 284.
Setting application default variables and constants
You can set default variables and application-level constants on the Application.cfm page. For
example, you can specify the following values:
A data source
A domain name
Style settings, such as fonts or colors
Other important application-level variables
Often, an Application.cfm page uses one or more
cfinclude tags to include libraries of
commonly used code, such as user-defined functions, that are required on many of the
applications pages.
Processing logins
When an application requires a user to log in, you typically put the
cflogin tag on the
Application.cfm page. For detailed information on security and creating logins, including an
Application.cfm page that manages user logins, see Chapter 16, “Securing Applications,” on
page 373.
Handling errors
You can use the
cferror tag on your Application.cfm page to specify application-specific error-
handling pages for request, validation, or exception errors, as shown in the example in the
following section. This way you can include application-specific information, such as contact
information or application or version identifiers, in the error message, and you display all error
messages in the application in a consistent manner.
For more information on error pages and error handling, see Chapter 14, “Handling Errors,” on
page 307.
Example: an Application.cfm page
The following example shows a sample Application.cfm file that uses several of the techniques
typically used in Application.cfm pages. For the sake of simplicity, it does not show login
processing; for a login example, see Chapter 16, “Securing Applications,” on page 373.
<!--- Set application name and enable Client and Session variables. --->
<cfapplication name="Products"
clientmanagement="Yes"
clientstorage="myCompany"
sessionmanagement="Yes">