Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q3011 In ASP, there's a "Global.asa" that executes whenever an ASP page is called. Is there such thing for ColdFusion?

irt.org | Knowledge Base | ColdFusion | Q3011 [ previous next ]

Q3011 In ASP, there's a "Global.asa" that executes whenever an ASP page is called. Is there such thing for ColdFusion?

Absolutely. The template is called "application.cfm". Whenever you call a CFML template, ColdFusion checks to see if there is an "application.cfm" template in the same directory, and executes it first if it does. If it doesn't find the application template, it continues up the web directory tree, all the way to the web root, searching for an "application.cfm". It stops searching when a) it finds and executes the first "application.cfm" found, or b) it reaches the web root and no application templates are found.

The application template can contain any CFML or HTML tags, just like any regular CFML template. Common uses for the "application.cfm" include defining application-wide variables, and including CFAPPLICATION and CFERROR tags for the entire application.

Feedback on 'Q3011 In ASP, there's a "Global.asa" that executes whenever an ASP page is called. Is there such thing for ColdFusion?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.