cfcfinclude路径将不会在Application.cfc中递归解析?

问题描述 投票:2回答:1

这是CF11。

我有一个依赖项集合,在我们运行的每个CFM和CFC的顶部都必须cfinclude。它是单个cfinclude,它递归包含其他文件。多年来,这种方法在每次页面加载时都起作用。大多数是旧版CFM页面,以及一些较新的CFC。但是,我最近尝试从Application.cfc内执行此操作,虽然它可以解析最顶层的包含,但无法解析子包含。我收到典型的cfinclude相对路径错误消息:

... Note: If you wish to use an absolute template path (for example, template="/mypath/index.cfm") with 
CFINCLUDE, you must create a mapping for the path using the ColdFusion Administrator. Or, you can use 
per-application settings to specify mappings specific to this application by specifying a mappings 
struct to THIS.mappings in Application.cfc. ...

从CFC本身(从具有URL x/index.cfm的浏览器中调用,我有:

getBaseTemplatePath() = x/index.cfm
getCurrentTemplatePath() = x/Application.cfc
expandPath("./") = x

并且从最顶层开始包括:

getBaseTemplatePath() = x/index.cfm
getCurrentTemplatePath() = y/TheInclude.cfm
expandPath("./") = x

此应用程序中的其他CFC-Application.cfc的同级文件与cfinclude的同级文件-产生相同的路径扩展,但也成功解析了子包含项。我是在做错什么,这是Application.cfc中的错误,还是...?

coldfusion coldfusion-11 application.cfc
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.