Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 242

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Variable scope
Variables available
Application
To all pages in an application for all clients
Client
For a single client browser over multiple browser sessions in one application
Session
For a single client browser for a single browser session in one application
For more information on using these variables, including how to use locks to ensure that the data they contain remains
accurate, see
"Using Persistent Data and
Application events and the Application.cfc file
Application events are specific occurrences during the life cycle of an application. Each time one of these events occurs,
ColdFusion runs the corresponding method in your Application.cfc file (also referred to as the application CFC). The
Application.cfc file defines application settings and implements methods to handle the application events.
Implement application CFC methods to handle the following events:
Event
Trigger
Application start
ColdFusion starts processing the first request for a page in an application that is not running.
Application end
An application time-out setting is reached or the server shuts down.
Session start
A new session is created as a result of a request that is not in an existing session.
Session end
A session time-out setting is reached.
Request start
ColdFusion receives a request, including HTTP requests, messages to the event gateway, SOAP requests, or Flash
Remoting requests.
Request
Immediately after ColdFusion finishes processing the request start event. The handler for this event is intended
for use as a filter for the request contents. For more information on the differences between request start and
request events, see
Request end
ColdFusion finishes processing all pages and CFCs for the request.
Exceptions
An exception occurs that is not handled in a try/catch block.
The Application.cfc file also defines application-wide settings, including the application name and whether the
application supports Session variables.
For more information on using application events and the Application.cfc file, see
event handlers in
Application.cfc" on page 241.
Other application-level settings and functions
Adobe recommends that when defining application-level settings, variables, and functions in new code, you do not
use the techniques used previous to ColdFusion MX 7. Instead, use the Application.cfc file and its variables and
methods, which provide more features and include logical, hierarchical structure.
If you do not have an Application.cfc file, 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.
Locking" on page 301.
"Managing requests in
Application.cfc" on page 246.
Last updated 1/20/2012
"Defining the application and its
237

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents