No Clean Feed - Stop Internet Censorship in Australia

Entries Tagged as 'Ajax'

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.

Subscribe