-2

当我想运行 idnex.cfm 时,出现错误“找不到包含的模板”。我应该使用 CF 管理映射,但是在不同的文件中有很多这样的错误。那么,有没有更简单的方法来解决问题呢?

Full error message:
Could not find the included template spiderBlock.cfm.
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.
Using relative paths (for example, template="index.cfm" or template="../index.cfm") does not require the creation of any special mappings. It is therefore recommended that you use relative paths with CFINCLUDE whenever possible. 
4

1 回答 1

1

该错误还应该告诉您它找不到哪个模板,包括 CF 正在寻找它的路径。该文件是否位于 CF 正在查找的位置?我怀疑不是。

如果您首先向我们提供完整的错误消息,那么我们有一些东西可以用来对此做出明智的评论。

正如其他人所建议的那样,可以在包含模板中引用包含文件的几种方法:相对于其自己的位置,绝对来自 CF 根,或绝对来自已解析的映射。因此,您可能还需要检查您的映射(将在 CFAdmin 或 Application.cfc 中定义)。

于 2011-10-08T06:12:02.423 回答