![]() ![]() ![]() |
||
|
This section describes the techniques used prior to ColdFusion MX 7 to define application-level settings, variables, and functions. Macromedia recommends that you do not use these techniques in new code that you write; instead, you should use the Application.cfc file and its variables and methods, which provide more features and include logical, hierarchical structure.
If you do not have an Application.cfc file, ColdFusion processes the following two pages, if they are available, every time it processes any page in the application:
Note: UNIX systems are case-sensitive. To ensure that your pages work on UNIX, always capitalize the A in Application.cfm and the O, R, and E in OnRequestEnd.cfm.
The Application.cfm page can define the application. It can contain the cfapplication
tag that specifies the application name, and code on this page is processed for all pages in the application. This page can define application-level settings, functions, and features.
The OnRequestEnd.cfm page is used in fewer applications than the Application.cfm page. It lets you provide common clean-up code that gets processed after all application pages, or specify dynamic footer pages.
Tip: The OnRequestEnd.cfm page does not execute if the page invokes a cflocation
tag.
For more information on the Application.cfm and OnRequestEnd.cfm pages, see Using an Application.cfm page. For information on placing these pages in the application directory structure, see Structuring an application.
Note: You can create a ColdFusion application without using an Application.cfc, Application.cfm, or OnRequestEnd.cfm page. However, it is much easier to use the Application.cfm page than to have each page in the application use a cfapplication
tag and define common application elements.
|
||
![]() ![]() ![]() |