ColdFusion not "seeing" my components
I have a dir开发者_开发问答ectory 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?
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 />
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.
精彩评论