Question

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">
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top