【发布时间】:2011-10-03 13:24:45
【问题描述】:
我的目录结构类似于
C:...\wwwroot\project\testPage.cfm
<html>
<head>
<title>Test Page</title>
</head>
<cfset this.mappings["/local"] = getDirectoryFromPath(getCurrentTemplatePath()) />
<cfform name="myform">
Pick as many as you like:
<cfinput id="pickers4" name="pickmany" type="checkbox" value="Apples">
<label for="pickers4">Apples</label>
<cfinput id="pickers5" name="pickmany" type="checkbox" value="Oranges">
<label for="pickers5">Oranges</label>
<cfinput id="pickers6" name="pickmany" type="checkbox" value="Mangoes">
<label for="pickers6">Mangoes</label>
<br/>
<cfinput name="pickmany-selected" bind="cfc:TestCFC.One({myform:pickmany})"><br />
</cfform>
</body>
</html>
C:...\wwwroot\project\TestCFC.cfc
<cfcomponent>
<cfscript>
remote function One(whatever){
return whatever;
}
</cfscript>
</cfcomponent>
由于某种原因,ColdFusion 服务器不会“看到”我的组件。我收到此错误。
我没有使用映射,因为我的组件与我的页面位于同一目录中。这在某一时刻有效,似乎 CF 服务器刚刚删除了一个设置或其他东西。有人知道为什么会这样吗?
【问题讨论】:
-
如果您转到
yourproject.com/project/TestCFC.cfc,您是否会被重定向到 CF 管理员以查看 CFC 的文档?您是否验证过您的路径确实是您所期望的?我认为 Jason 的修复可以做到这一点......也许可以尝试local.project.TestCFC,因为您正在创建本地映射? -
我收到一个灰色错误框,提示找不到 CFC。我尝试过使用/不使用本地以及使用/不使用该映射。当它工作时,我没有使用映射。这台机器最近一直蓝屏,我将把我的问题归咎于那个并重建我的电脑。如果代码适用于全新安装的 ColdFusion,我会通知您。
标签: coldfusion coldfusion-9 cfc