Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application.cfc built-in variables

In ColdFusion version 9, I have the following in Index.cfm:

<cfdump var="#Application#">

But the only thing I'm getting back is a struct with the applicationname - no other variables like rootPath, mappings or customTagPath.

Here's what I have in Application.cfc:

<cfcomponent output="false">
<cfset this.name = left("App_#hash(getCurrentTemplatePath())#",64)>
<cfset this.applicationTimeout = createTimeSpan(0,8,0,0)>
<cfset this.sessionManagement=True>
<cfset this.loginStorage = "session">
<cfset this.clientManagement = False>
<cfset this.setClientCookies = True>
<cfset this.setDomainCookies = False>
<cfset this.scriptProtect = "all">
<cfset this.rootPath = getDirectoryFromPath(getCurrentTemplatePath())>
<cfset this.mappings = this.rootPath>
<cfset this.customTagPaths = "#this.rootPath#Components">
like image 490
Phillip Senn Avatar asked Feb 10 '26 17:02

Phillip Senn


1 Answers

That's because those settings aren't in the Application Scope. You are confusing Application settings versus Application values. If you want them available in the Application scope, you can simply set them up in your onApplicationStart(). You can also see them via the This scope of course, so you copy the values there.

like image 177
Raymond Camden Avatar answered Feb 15 '26 06:02

Raymond Camden