2010-03-11 3 views
3

, 나는 Index.cfm에 다음과 같은 한 :Application.cfc 내장 변수의 ColdFusion 버전 9에서

<cfdump var="#Application#"> 

하지만 다시 받고 있어요 유일한 것은이 ApplicationName을 가진 구조체이다 - 다른 변수 rootPath, mappings 또는 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"> 

답변

5

있다고. 애플리케이션 설정과 애플리케이션 값을 혼동하고 있습니다. 응용 프로그램 범위에서 사용할 수있게하려면 onApplicationStart()에서 간단하게 설정할 수 있습니다. 또한이 범위의 코스를 통해 볼 수 있으므로 값을 복사 할 수 있습니다. 예를 들어

+0

, 당신은이 작업을 수행 할 수 있습니다 \t \t 이 경우 방금 사용자 정의 태그 경로를 복사했습니다. –

+0

그래서 'this.foo'가 애플리케이션 값이고 'application.bar'가 애플리케이션 설정이라고 말하는 것입니까? 나는 응용 프로그램 설정이 모두 어딘가에 정의되어 있고 값이 무엇이든간에 원하는 것으로 가정합니다. –

+0

아니요 - this.foo는 올바른 경우 응용 프로그램 설정입니다. _variable_ 응용 프로그램을 설정하려면 응용 프로그램 범위를 사용합니다. 예, 애플리케이션 설정은 여기에 표시됩니다. http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-750b.html –