2011-10-07 32 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中定義)。