冷融合映射错误
注意:如果您希望使用绝对模板路径(例如, template="/mypath/index.cfm") 与 CFINCLUDE,您必须创建一个 使用 ColdFusion Administrator 映射路径。
我进入了管理页面,但不知道要在这里输入什么。 我对冷融合还很陌生。任何人都知道为什么会发生这种情况。
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.
I went to the administration page but not sure what to put in here.
I'm pretty new to coldfusion. anyone got any ideas why this would be happening.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CFINCLUDE 使用与 cfinclude 所在文件相关的相对路径,因此如果想要在另一个目录中包含文件,1. 它必须位于站点的 wwwroot(或根目录或子目录)内,2. 您可以通过执行以下操作转到其他目录...希望这会有所帮助。如果您想要包含 wwwroot 之外的文件,则在包含该文件时,您需要使用与上述相同的语法在 Coldfusion Administrator 中映射该目录。
CFINCLUDE uses relative paths in relation to the file where the cfinclude is, so if want to include a file in another directory, 1. it has to be inside your wwwroot (or the root directory, or subdirectories) of your site, 2. you can go to other directories by doing ... hope this helps a little bit. If you want to include a file that is outside of your wwwroot, then you'll need to map that directory in Coldfusion Administrator using the same syntax above when you do include it.
要添加映射,请打开 Coldfusion 管理员。
服务器设置>映射
有 2 条路径。逻辑和目录。
逻辑可以是您想要的任何内容,目录是它映射到的位置。
例如。您的 Web 根目录下可能有一个文件夹,其中存储了映射为的电子邮件模板:
您可以从任何 cf 模板中
并获取映射。您也可以使用映射来创建新对象。让我们假装忘记密码是一个 cfc。
扩展 cfc 时映射也起作用。除了一个小例外。没有前导斜杠。
我非常确定首先会检测到映射,因此如果您有一个同名的文件夹,它可能不会被选中。
在 cf9 中,您还可以在 Application.cfc 中指定映射,而不是在 Coldfusion 管理员中指定,这会影响服务器上的所有应用程序。例如。
您需要在 cfadmin 设置页面上勾选启用每个应用程序设置选项。
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0b63c-7fd5.html
To add a mapping, open your coldfusion administrator.
Server Settings > Mappings
There are 2 paths. Logical and Directory.
Logical can be anything you want, and directory is where it maps to.
eg. you might have a folder below your web root which stores email templates mapped as:
You can
<cfinclude template="/emails/forgotPass">
from any cf template and the mapping would get picked up.You can use the mappings for new object creation too. Lets pretend forgotPass is a cfc.
Mappings also work when extending cfcs. With one small exception. No leading slash.
Im pretty sure mappings are detected first, so if you have a folder with the same name it might not get picked up.
In cf9 you can also specify your mappings in your Application.cfc, instead of coldfusion administrator, which affects all applications on your server. eg.
You'll need to tick the Enable Per App Settings option on the cfadmin Settings page.
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0b63c-7fd5.html