Per App Settings Example
Per App Settings in CF8 allows you to set 1.Mappings and 2.Custom tag paths on a per-application basis.
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:
1.First enable per-application settings on the Settings page of the ColdFusion Administrator. Go to Administrator -> Settings -> Click on Enable Per App Settings -> Submit.
2. Set the mappings or custom tag paths in the Application.cfc file.
Note: The "Application variables" in the "Memory Variables" page of the Administrator should be enabled.
Here is a per application settings example.
The following will be the code in your Application.cfc file:
<cfset MyMappings["/MyMap1"] = "C:\Temp\per_app_dir1">
<cfset This.mappings = MyMappings>
<cfset This.mappings["/MyMap2"] = "C:\Temp\per_app_dir2">
<cfset This.customtagpaths = "C:\Temp\my_custom_tags_dir">
<cfset This.mappings["/MyMap3"] = "C:\Temp\my_custom_tags_dir">
Note: These above mappings and custom tags should have be defined from the administrator and these will be overriden by the per app settings as defined in the above cfc.
Here is how you use this in your code:
Run the following code in a test.cfm
<cfinclude template = "/MyMap1/per_app_test1.cfm">
<br>
<!---- per_app_test2.cfm is present under C:\Temp\per_app_dir2\ and you should be able to include it. ---->
<cfinclude template = "/MyMap2/per_app_test2.cfm">
<br>
<!---- mycustomtag.cfm is present under C:\Temp\my_custom_tags_dir\ and you should be able to use this custom tag. ---->
<cf_mycustomtag>
<br>
<!---- You can also use cfmodule like below ------>
<cfmodule template = "/MyMap3/mycustomtag.cfm">
<br>

There are no comments for this entry.
[Add Comment]