我想第一次使用映射,我有一些问题。在我CFadmin我创建了一个映射这是这样的:Coldfusion映射cfinclude
逻辑路径:
/email_sender
目录路径:
E:\sites\Example.Com\cf_modules\autoresponders\Emails\emailLists
我试图从.cfc访问包含文件。在我的cfc里面,我有一个包含在同一个文件夹中的文件,它工作的很好,但是包含文件正在根据我传递的信息绑定到另一个包含文件。
组件中的包含文件在其中包含此代码。
<cfmail from="#emailData.sender#" to="#surveymain.email#" subject="#subject#" type="HTML" >
<cfinclude template="#emailData.includePath#" >
</cfmail>
只是为了更清楚,这是我的总的文件系统:
access.cfm -> some.cfc -> include_1 (works) -> include_2 (issue with the path)
我有一个try/catch哪些电子邮件我的错误,它位于include_1内。
如何使用我创建的映射最终能够访问我的包含文件?
请注意,emailLists
之后,我有动态文件夹,根据我试图发送电子邮件的客户端而有所不同。因此该路径的最终结果将是:
E:\sites\Example.Com\cf_modules\autoresponders\Emails\emailLists\client_A\email_template.cfm
我试图用我的映射做这个 <cfinclude template="/email_sender/#emailData.includePath#" >
这给了我这个错误:
The path to the CFC must be specified as a full path, or as a relative path from the current template, without the use of mappings.
而且,我试着包括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.
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.
任何帮助/建议将不胜感激
编辑: 重新启动该工作的版本是这样的一个服务器后: <cfinclude template="/email_sender/#emailData.includePath#" >
感谢那些谁回答。
自从您添加映射后,您是否重新启动了服务器? – John
当然它必须是这....感谢提醒我,现在它工作正常.. – Geo