Description:-

The Application.cfc file defines application-wide settings and variables, as well as application event handlers. we can implement the following events through Application.cfc.

Method/EventWhen run
onApplicationStartThe application starts when the first request for a page is processed or an event gateway instance invokes the first CFC method, Flash Remoting request, or a web service invocation. This method is useful for setting application-wide (Application scope) variables, such as the names of data sources.
onApplicationEndThe application ends: when the application times out or the server shuts down.
onSessionStartA new session is created as a result of a request that is not in an existing session, including ColdFusion event gateway sessions. The application must enable sessions for this event to happen.
onSessionEndA session time-out setting is reached. This event is not triggered when the application ends or the server shuts down.
onRequestStartColdFusion receives any of the following: a request, an HTTP request (for example, from a browser), a message to an event gateway, a SOAP request, or a Flash Remoting request.
onRequestThe onRequestStart event has been completed. This method acts as a filter for the requested page content.
onCFCRequestIntercepts any HTTP or AMF calls to an application based on a CFC request. Whereas onRequest handles only requests made to ColdFusion templates, this function controls Ajax, Web Service, and Flash Remoting requests.
onRequestEndAll pages and CFCs in the request have been processed: equivalent to the OnRequestEnd.cfm page.
onErrorWhen an exception occurs that is not caught by a try/catch block.
onAbortRuns when you execute the CFML tag cfabort or cfscript "abort". If the showError attribute is specified in cfabort, onError method is executed instead of onAbort. When using cfabort, cflocation, or cfcontent tags, the onAbort method is invoked instead of onRequestEnd.
onMissingTemplateWhen ColdFusion receives a request for a non-existent page.