ColdFusion 没有“看到”我的组件
我有一个类似的目录结构
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 服务器刚刚删除了一个设置或其他东西。有人知道为什么会发生这种情况吗?
I have a directory structure similar to
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>
and for some reason the ColdFusion server won't "see" my component. I get this error.
I wasn't using mappings as my component was located in the same directory as my page. This worked at one point, and it seems as though the CF server has just dropped a setting or something. Anyone have some idea as to why this is happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,既然您的 CFC 位于 C:...\wwwroot\project\TestCFC.cfc,那么路径 (FQN) 不是 project.TestCFC 吗?
你尝试过这个吗:
Well, since your CFC is located in C:...\wwwroot\project\TestCFC.cfc wouldn't the path (FQN) be project.TestCFC?
Did you try this:
这本身并不是一个答案;而是一个答案。但建议进行调查。
浏览器实际上请求的 URL 是什么?您收到的 HTTP 错误是什么?
另外:我怀疑 CF 映射在这里是否相关,因为 JS 正在映射客户端 HTTP 请求,而 CF 映射只是让 CF 可以访问其本地系统(即:服务器端)上的资源。如果您需要将任何内容映射到 URL 的位置,则它需要是 Web 服务器虚拟目录,而不是 CF 映射。
This is not an answer, per-se; but a suggestion for investigation.
What's the URL that is actually being requested by the browser under the hood? And what's the HTTP error you get?
Also: I doubt CF mappings are relevant here because JS is mapping a client-side HTTP request, and CF mappings are just so CF can access resources on its local system (ie: server side). If you need to map anything to the location of the URL, it needs to be a web server virtual directory, not a CF mapping.