I then call the ajaxproxy like this
%26lt;cfajaxproxy cfc=''/kost/AuthenticationSystem''
jsclassname=''AuthenticationSystem'' /%26gt;
It works until the javascript is run to use the function in
the component.
var auth = new AuthenticationSystem();
auth.validateCredentials()
When I look what it tryes to run the path is
http://z9102853.dk.capgemini.se/AuthenticationSystem.cfc?method=validateCredenti als%26amp;
but it should be
http://z9102853.dk.capgemini.se/kost/AuthenticationSystem.cfc?method=validateCre dentials%26amp;
why does it not go to my mapping /kost?cfajaxproxy
hmm... iirc the cfc attrib of cfajaxproxy tag requires a
dot-delimited
path to a cfc, not /-delimited...
--
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
cfajaxproxy
quote:
Originally posted by:
Newsgroup User
hmm... iirc the cfc attrib of cfajaxproxy tag requires a
dot-delimited
path to a cfc, not /-delimited...
Yes ofcause.
I have now changed it to
%26lt;cfajaxproxy cfc=''kost.AuthenticationSystem''
jsclassname=''AuthenticationSystem'' /%26gt;
But with the same result.
it still looks for AuthenticationSystem at
http:\\server\AuthenticationSystem
and not at the corect place
http:\\server\kost\AuthenticationSystem
Is it not possible to have the ajax cfc's in a sub dir not in
the wwwroot??
Have you tried to call the CFC directly from that path,
verifying that it can be reached? Possibly an issue with your
server resource/virtual directory mapping.
When I call
http://z9102853.dk.capgemini.se/\kost\AuthenticationSystem.cfc
from the path I do get the cfc description.
So I can reatch the mapping in this way.
I found this in Ben Forta's blog
http://www.forta.com/blog/index.cfm/2007/5/31/ColdFusion-Ajax-Tutorial-1-AutoSug gest#cFCFBA570-3048-80A9-EFE867939367DE55
We found our problem... using 'Virtual Directories' in IIS, the
ColdFusion AJAX feature binding won't work (it just can't seem to
find the cfc file). When the same files are installed on the web
root, it works 100%.
What really threw us off was that, with our original
configuration, the cfc's were accessible via a cfinvoke and via the
url...
Unfortunately, it will be alot of work to re-configure our
other webservers so that we can utilize these new features.
# Posted By Ed | 11/1/07 4:51 PM
I think that this is an error in CF8. No one will put all
there cfc's in the webroot just to be able to make an call using
ajax. I'm waiting for an error fix from Adobe.
This is also why I do see
ttp://z9102853.dk.capgemini.se/AuthenticationSystem.cfc?method=validateCredenti als%26amp;
and not (as it should be)
ttp://z9102853.dk.capgemini.se/
kost/AuthenticationSystem.cfc?method=validateCredentials%26amp;
hey Kruse, I'm having the same exact problem.. It's identical
in everyway.. Why is is messing up that /kost/ directory?? Well..
Let's keep this going. Let me know if you make any progress on the
solution to this problem and not a work-around. Justin
Hi Justin, I have dropped using this cfajaxproxy.
Instead I have started to make my interfaces in Flex.
You can do more nice things in Flex than you can do in
Coldfuision and Ajax.
Besides it can be transferred into Air (desktop application)
with a little effort.
thanks kruse! I appreciate your insights.
here's from the CF8 Developers' Guide, Chapter 35, page 650:
Using bind expressions
To specify a bind expression, use one of the following
formats:
cfc:componentPath.functionName(parameters)
Note:
The component path cannot use a mapping. The componentPath
value must be
a dot-delimited path from
the web root or the directory that contains the current page.
.....
---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
Azadi, one thing is what the Development guide says and
another thing is what works in real life.
I have tested this and I can鈥檛 get it to work.
The only way I can get it to work is if I place the cfc in
the web root. What I don鈥檛 want to.
hi kruse,
i was actually answering justin's previous comment ''why is it
messing up
that /kost/'' directory?'' and pointing out that what he (and
you) was up
against is not a bug, but a documented way cf8 works: you CAN
NOT bind
to a cfc located in a mapped directory outside of web root.
---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
Thanks Azadi. It's nice to get concrete confirmation.
Although it's documented, it did go against both of our logic of
how we thought it should work, especially after we'd successfully
completed other tasks, like calling an object from a mapped
directory. I've been able to find a suitable work around as well as
gain more working knowledge about the Coldfusion Environment.
''No one will put all there cfc's in the webroot just to be
able to make an call using ajax. I'm waiting for an error fix from
Adobe.''
I agree 100%. I'm using IIS 5 web server as well. Adobe's CF8
project manager were not doing a good job.
You don't need to put your CFC in the web root! It simply
needs to be in a non-aliased directory OFF OF the web root. I
placed a components directory in my CFIDE directory and it works
just fine. You will however need a ColdFusion mapping to the first
directory - in my case CFIDE.
%26lt;cfajaxproxy cfc=''CFIDE.components.myCompnent''
jsclassname=''myFuncs''%26gt; with my web root being
''C:\inetpub\wwwroot'' and the component file path as
''C:\inetpub\wwwroot\CFIDE\components\myComponent.cfc''. My
ColdFusion mapping is ''Logical Path = /CFIDE, Directory Path =
C:\inetpub\wwwroot\CFIDE.
Of course, the directories and files must have the proper
permissions.
No comments:
Post a Comment