Adobe COLDFUSION 9 Manual page 249

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Method
onRequestEnd
onMissingTemplate
onError
When ColdFusion receives a request, it instantiates the Application CFC and runs the Application.cfc code in the
following order:
• CFC initialization code at the top of the file
, if not run before for this application
onApplicationStart
, if not run before for this session
onSessionStart
onRequestStart
, or the requested page if there is no onRequest method
onRequest
onRequestEnd
The following methods are triggered by specific events:
onApplicationEnd
onSessionEnd
onMissingTemplate
onError
The
and
onApplicationEnd
access request variables or display information to the user. The
specifies a CFML page that does not exist. The
use its
argument to determine the context.
Event
Managing the application with Application.cfc
Use the
onApplicationStart
control resources that are used by multiple pages and requests and must be consistently available to all code in your
application. Such resources include data sources, application counters such as page hit variables, or style information
for all pages.
The
method executes when ColdFusion gets the first request for a page in the application after
onApplicationStart
the server starts. The
onApplicationEnd
application is inactive for the application time-out period.
The following are some of the ways you use these methods. For more information, see entries for onApplicationStart
and onApplicationEnd in the CFML Reference.
Defining application utility functions
Functions that you define in Application.cfc and do not place in a shared scope are, by default, available only to other
methods in the CFC.
If your Application.cfc implements the
also directly available in to the target page, because Application.cfc and the target page share the Variables scope.
When run
All pages and CFCs in the request have been processed: equivalent to the OnRequestEnd.cfm page.
When ColdFusion receives a request for a nonexistent page.
When an exception occurs that is not caught by a try/catch block.
methods do not execute in the context of a page request, so they cannot
onSessionEnd
method does not always execute in the context of a request;
OnError
and
methods to configure and manage the application; that is, to
onApplicationEnd
method executes when the application server shuts down or if the
method, any utility functions that you define in Application.cfc are
onRequest
Last updated 8/5/2010
method is triggered when a URL
onMissingTemplate
244

Advertisement

Table of Contents
loading

Table of Contents