No Clean Feed - Stop Internet Censorship in Australia

cfajaxproxy exposing CFC path in page source

[Edit: The following post has been edited/re-worded in an attempt to clear up it's meaning]

I've been playing around with ColdFusion's cfaxajproxy and loving it. I was interested however to find that when the page is rendered in the browser, cfajaxproxy outputs (in the source code) the full path [Edit: literal relative path] to the CFC I'm having it call.

Example:

Source output (Javascript):
var _cf_Expertise=ColdFusion.AjaxProxy.init('/x/y/z/Expertise.cfc','expertiseCFC');

I tried using a Mapping in the CF Admin to the directory (under my webroot) containing my CFCs but still the full path [Edit: literal relative path] from root to my CFC is exposed.

Example:
Mapping made in CF Admin
"/mapping" -> "c:/.../x/y/z/"

Source output (Javascript):
var _cf_Expertise=ColdFusion.AjaxProxy.init('/x/y/z/Expertise.cfc','expertiseCFC');

When I created a Mapping to a folder *above* the webroot containing my CFC the source output changed to include the mapping reference (this is the behaviour/output I wanted, just without having to have the folder containing the CFC above the webroot).

Example:
Mapping made in CF Admin
"/mapping" -> "c:/.../{folder above web root}/"

Source output (Javascript):
var _cf_Expertise=ColdFusion.AjaxProxy.init('/mapping/Expertise.cfc','expertiseCFC');

Why is it that (using the CF Admin mapped path) when the CFC folder is above the webroot cfaxajproxy outputs the shorter mapped reference to the Javascript source code but when the CFC folder is under the webroot the full relative path from the webroot to the CFC is exposed in the Javascript source code? Is there a way around this so that the mapping is always output (I need my CFCs within the webroot, not above)?

[Edit: Additional Info]

This is how I am calling cfajaxproxy:

<cfajaxproxy
cfc = "mapping.Expertise"
jsclassname = "expertiseCFC" />

Where "mapping" is the virtual Mapping reference set within CF Admin.

Bookmark and ShareSubscribe

cfajaxproxy exposing CFC path in page source

Comments

Raymond Camden

Raymond Camden wrote on 03/23/10 9:13 PM

I don't believe it is the "full" path, but rather the web server path, which is required for your Ajax calls to work at all.
Steve

Steve wrote on 03/23/10 9:19 PM

@Ray: Yes, my apologies, it is not technically the 'full' (as in absolute) path but the 'literal relative'(erm..?) web server path from the webroot. Sorry if that was not clear. I'm looking to see why the CF Admin mapped path is not used though instead of this relative-from-webroot path. :)
Raymond Camden

Raymond Camden wrote on 03/24/10 5:38 AM

Well because the CF Admin mapping means nothing to your browser. Remember - your browser still needs something real to hit.
Brian Kotek

Brian Kotek wrote on 03/24/10 7:19 AM

Because the AJAX request is just like any other HTTP request, the web server has to know where the file is before the request is even handed off to the CF server for processing. In other words, the CF mapping only means anything to CF. The web server itself has no idea what a "CF mapping" is.

Leave a comment

Tell us about yourself
(required field)
(required field)
Comment and preferences
Leave this field empty: