2011-10-07 102 views
-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. 
+0

这是一个非常不祥的问题。你是否在处理别人的代码,并试图设置它的本地工作副本 - 然后在运行应用程序时,得到一系列这类错误?如果是这样,答案是确定应用程序中使用的映射,并镜像CFAdmin的配置以匹配应用程序的配置。 如果你正在构建一个新的应用程序,并将这些错误直接告诉了你,你会想看看你如何引用每个;一定要参考工作区中每个cfm的适当相对路径。 –

+0

是的我正在与他人合作代码 – Wolandello

+0

@ user978707请尝试提供更多的细节问题。由于它现在坐落,它可能因低质量而处于关闭的危险中。 – Sampson

回答

1

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

如果您首先给我们提供完整的错误信息,我们有一些工作要做出明智的评论。

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