Application.cfc
and if found, it will execute it for you implicitly. This file is used to define the following:this
scope and in the pseudo-constructor of the object.application
scope can be leveraged for global persistence. Also note, that because it is instantiated on every request, you have the potential to change settings and events on a per-request basis if needed. Great use cases for this can be the following:Application.cfc
in cfdocs: https://cfdocs.org/application-cfc. Application.cfc
also acts like a big event listener waiting for the ColdFusion server engine to call its methods in callback fashion. You can listen to when an error occurs to even when a missing template is requested and much more. If I am missing some here, please refer to the latest documentation for the latest updates: https://cfdocs.org/application​onApplicationStart
event is broadcast. It only happens once, until your application times out, the process is restarted, or the computer is restarted.onRequestStart()
as a before advice and the onRequest
as an around advice over the request. You must include
the requested page or the page will never be processedeventName
that generated the exception.targetPage
that the abort came from.coldbox create app MyApp
Application.cfc
, with a unique name which defines the separate ColdFusion applications. Anything in that directory and sub-directories will be considered part of the application.this.name
property as the unique name for it. It can contain the variables scopes like application
, session
, and client
which are unique per this reservation name. This way two ColdFusion applications can have different persistence variable scopes and can even be embedded between each other:application
scopes. The application is reserved for a specific duration which is defined using the this.applicationTimeout
property or defined in the Administrator. Once it expires, the engine will purge it from memory and recreate it fresh.applicationStop()
. Be careful though, as it stops full execution and restarts it. (https://cfdocs.org/applicationstop)