ColdFusion 没有“看到”我的组件

发布于 2024-12-07 12:29:07 字数 1392 浏览 0 评论 0原文

我有一个类似的目录结构

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.

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谁许谁一生繁华 2024-12-14 12:29:07

好吧,既然您的 CFC 位于 C:...\wwwroot\project\TestCFC.cfc,那么路径 (FQN) 不是 project.TestCFC 吗?

你尝试过这个吗:

<cfinput name="pickmany-selected" bind="cfc:project.TestCFC.One({myform:pickmany})"><br />

Well, since your CFC is located in C:...\wwwroot\project\TestCFC.cfc wouldn't the path (FQN) be project.TestCFC?

Did you try this:

<cfinput name="pickmany-selected" bind="cfc:project.TestCFC.One({myform:pickmany})"><br />
谈场末日恋爱 2024-12-14 12:29:07

这本身并不是一个答案;而是一个答案。但建议进行调查。

浏览器实际上请求的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文