Adobe COLDFUSION 9 Manual page 243

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
The Application.cfm page can define the application. It can contain 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.
The OnRequestEnd.cfm page does not execute if the page runs a
For more information on the Application.cfm and OnRequestEnd.cfm pages, see
page 252. For information on placing these pages in the application directory structure, see
application" on page 239.
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
tag and define common application elements.
cfapplication
Specifying settings per application
Set the following on a per-application basis:
• Mappings
• Custom tag paths
These settings override the server-side settings in the ColdFusion Administrator for the specified application only.
Specifying per application settings does not change the server-wide settings. To set per-application settings, first enable
per-application settings on the Settings page of the ColdFusion Administrator. You then set the mappings or custom
tag paths in the Application.cfc file.
Custom Tags in per-application settings override those defined in the ColdFusion Administrator. For example, if you
have two custom tags of the same name and they are in different locations in the Administrator and per-application
settings, the one in the per-application settings is taken first.
Note: Per-application settings are supported in applications that use an Application.cfc file only, not in applications that
use an Application.cfm file. The per-application settings do not work if you have disabled application variables in the
Memory Variables page of the Administrator.
Set the mappings per application
Check the Enable Per App Settings option on the Settings page of the ColdFusion Administrator.
1
Include code like the following in your Application.cfc file:
2
<cfset THIS.mappings["/MyMap"]="c:\inetpub\myStuff">
or
<cfset StructInsert(THIS.mappings, "/MyMap", "c:\inetpub\myStuff")>
(To use the second format, you must first create a
Set the custom tag paths per application
1
Check the Enable Per App Settings option on the Settings page of the ColdFusion Administrator.
2
Include code like the following in your Application.cfc file:
<cfset customtagpaths = "c:\mapped1,c:\mapped2">
<cfset customtagpaths = ListAppend(customtagpaths,"c:\mapped3")>
<cfset This.customtagpaths = customtagpaths>
cfapplication
cflocation
structure.)
THIS.mappings
Last updated 8/5/2010
tag that specifies the
tag.
"Using an Application.cfm
"Structuring an
238
page" on

Advertisement

Table of Contents
loading

Table of Contents