• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. Using the ColdFusion Applica... > Example: Creating a Basic Applicatio...

Example: Creating a Basic Application.cfm File

The cornerstone of the ColdFusion application framework is a special file called the Application.cfm file. This file is special in the ColdFusion environment because the CFML code within it is processed before the code in any other ColdFusion template you request. For example, suppose you made a request for a script named search.cfm to run. If there is an Application.cfm file in the same folder as search.cfm, the code within the Application.cfm file will be executed first and then the code within search.cfm will be executed. In essence, you can think of an Application.cfm file as being automatically included at the start of the requested script, just as if you had used the <cfinclude> tag.

CAUTION

If you're running ColdFusion on a UNIX or Linux system, you need to use the uppercase A when naming the Application.cfm file. Microsoft file systems are not case sensitive, so you're free to use Application.cfm or application.cfm on the Windows platform. A good practice is to always use the uppercase A when naming the Application.cfm file because you won't have any issues if you ever need to migrate an application from Windows to UNIX/Linux.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint