3

ColdFusion バージョン 9 では、Index.cfm に次のものがあります。

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

1 に答える 1

5

これは、これらの設定がアプリケーション スコープにないためです。アプリケーションの設定とアプリケーションの値を混同しています。それらを Application スコープで利用できるようにしたい場合は、onApplicationStart() で簡単に設定できます。もちろん、 This スコープを介してそれらを表示することもできるため、そこに値をコピーします。

于 2010-03-11T14:11:35.290 に答える