的Application.cfc内置变量
-
19-09-2019 - |
题
在ColdFusion的版本9,我中Index.cfm以下内容:
<cfdump var="#Application#">
但我发现了后面的唯一的事情就是与applicationName的一个结构 - 没有其他变量,如ROOTPATH,映射或customTagPath
下面就是我在的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">
解决方案
这是因为这些设置不在适用范围。你混淆了应用程序的设置的与应用价值。如果你希望他们在应用范围内都有效,你可以简单地设置它们在你的onApplicationStart()。您也可以通过当然这个范围看,所以你复制的价值在那里。
不隶属于 StackOverflow