Thursday, November 03, 2011

Application.cfm and Application.cfc

  • This is the first ColdFusion page that executes in a ColdFusion Application.
  • This file basically contains application level setting like setting of session, cookie variables for the application and data source for the application and some application level objects (if there is any).
  • It is not compulsory a ColdFusion application always needs the Application.cfm/ Application.cfc.
  • If an application contains both Application.cfm and Application.cfc in a root folder then Application.cfc will get more priority than Application.cfm in ColdFusion MX 7 +.
  • Application.cfc was first introduced in ColdFusion MX 7.
  • It is always advisable to write Application.cfc/Application.cfm instead of application.cfc/application.cfm. As application.cfc/application.cfm creates case sensitive issue in Linux system.

  • If we will place application.cfm in the root of our Application folder then all the codes of Apllication.cfm executes before the actual page execution.
  • If we will place Application.cfc in our project root then only some functions associated with a particular event gets executed. E.g onApplicationStart, onSessionStart, onApplicationEnd, onSessionEnd etc.
  • In a Application if the sub folder contains Applicaion.cfc / Application.cfm then the sub folders Application.cfc/cfm setting overwrites with the parent Application.cfc/cfm.

No comments:

Post a Comment