Few important tips and notes about Application.cfm/cfc:
This is the first ColdFusion file that gets executed by the ColdFusion Application server even if we request for some other file. Example: When we type http://www.mySite.com/index.cfm, Application.cfm/cfc gets executed first and then index.cfm. Application.cfc/cfm and all objects gets instantiated for each server page request.
We may or may not have Application.cfc/cfm inside one project web root.
Application files are mainly used to set application (global) level objects before executing the server files of the project.
What if we are requesting for a ColdFusion file present inside a deep subfolder level? If we have Application.cfc/cfm inside the same folder (where our requested file resides) then the same Application.cfc/cfm will be executed. If we do not have Application.cfm/cfm inside the same folder (where our requested file resides) then ColdFusion application server will search for the Application files in the next higher folder level (backward), it still does not find then one level up till the web root. At any level if it finds the Application files then it will execute that.
What if we have both Application.cfc and Application.cfm present in the same folder? Application.cfc will be given more priority (Application.cfm will be ignored) if the ColdFusion version is ColdFusion MX 7 +. If it is any version less that ColdFusion MX 7 then Application.cfm will be given more priority (Application.cfc will be ignored). Reason: Application.cfc got introduced in CFMX 7 version onwards and given more priority over Application.cfm.
Linux is case sensitive. If it is a Linux box then, Application.cfc/cfm will be executed by the ColdFusion application server NOT application.cfc/cfm. So it is always a good habit to use “A” instead of “a” for Application.cfc/cfm.