Phillip Senn
Phillip Senn

Reputation: 47635

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">

Upvotes: 3

Views: 582

Answers (1)

Raymond Camden
Raymond Camden

Reputation: 10857

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.

Upvotes: 5

Related Questions