The following table briefly describes the application event methods that you can implement in Application.CFC:
Method name |
Method runs when |
---|---|
Runs when you execute the tag cfabort |
|
The application ends: the application times out, or the server is stopped |
|
The application first starts: the first request for a page is processed or the first CFC method is invoked by an event gateway instance, or a web services or Flash Remoting CFC. |
|
HTTP or AMF calls are made to an application. |
|
An exception that is not caught by a try/catch block occurs. |
|
ColdFusion received a request for a non-existent page. |
|
The onRequestStart method finishes. (This method can filter request contents.) |
|
All pages in the request have been processed: |
|
A request starts |
|
A session ends |
|
A session starts |
|
A ColdFusion server starts |
All parameters to these methods are positional. You can use any names for these parameters.
When a request executes, ColdFusion runs the CFC methods in the following order:
- onApplicationStart (if not run before for this application)
- onSessionStart (if not run before for this session)
- onRequestStart
- onRequest/onCFCRequest
- onRequestEnd
The onApplicationEnd, onSessionEnd, and onError CFCs are triggered by specific events.