tags:

views:

29

answers:

1

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">
+4  A: 

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.

CF Jedi Master
As an example, you can do this:<cffunction name="onApplicationStart" returnType="boolean" output="false"> <cfset application.customtagpaths = this.customtagpaths> <cfreturn true></cffunction>In this case I just copied the custom tag path.
CF Jedi Master
So you're saying that 'this.foo' is an application value, and 'application.bar' is an application setting? I assume that the application settings are all defined somewhere and the values are whatever you'd like?
Dan Sorensen
No - this.foo would be an application setting, IF it were valid. To set an application _variable_, you use the application scope. And yep, the Application settings are listed here:http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-750b.html
CF Jedi Master