3 Replies Latest reply on Sep 1, 2009 1:25 PM by BKBK

    COLDFUSIONCFAJAX PROXY

    Meenakshi Mundada

      Hi,

       

      I am trying to implement this Demo on third ecample "Using the Ajax proxy" from this site http://www.adobe.com/products/coldfusion/demos/. It works fine when i keep the files in wwwroot directoryof inetpub. but when i am trying to accessit from D: or any of the existing coldfusion sites... i am getting an unknown error when i click on button "Say Hello".. Please can anyone help me out... Its urgent....Thanks in advance

        • 1. Re: COLDFUSIONCFAJAX PROXY
          BKBK Adobe Community Professional & MVP

          Create a mapping in the Coldfusion Administrator, and use it to point to files that are away from the web root. For example, create the following mapping:

           

          Logical Path: /myDir

          Directory Path: D:\anyPath\myDirectory

           

          You can then create an instance of D:\anyPath\myDirectory\test.cfc as

           

          <cfset testObject=createobject("component","myDir.test")>

           

          and you can include D:\anyPath\myDirectory\myFile.cfm in any arbitrary page, using

           

          <cfinclude template="\myDir\myFile.cfm">

          • 2. Re: COLDFUSIONCFAJAX PROXY
            Meenakshi Mundada Level 1

            Hi ,

            The solution provided by you has still not resolved the problem.When the file is placed in the C:\Inetpub\wwwroot, the path being referred is \myDirectory\ServerSidehelloworld.cfc and is working perfectly fine whereas if it is placed in D:\anyPath\myDirectory\, it is only being referred as ServerSidehelloworld.cfc for the following cfc file

            <cfajaxproxy cfc="ServerSidehelloworld" jsclassname="helloworldproxy">

            as given in the demo.

            The path given as myDir.ServerSidehelloworld is also throwing an error when given for cfc attribute of <cfajaxproxy>.

            Please provide your comments on how to access this cfc file when placed in the D: directory of the machine.

            On debugging we found that it is throwing error saying req.Status ="404" and req.StatusText="Not Found" when

            req.send(

             

             

            null);( where var

            req=$A.createXMLHttpRequest();) in cfajax.js file.

            • 3. Re: COLDFUSIONCFAJAX PROXY
              BKBK Adobe Community Professional & MVP

              You're right, Meenakshi. Relative paths to a cfc and paths derived from a mapping are valid when used in createobject() and cfinclude. However, they fail when used as the value of the cfc attribute in <cfajaxproxy>. Shame.

               

              I have submitted a bug report. Contents follow:

               

              Put the cfc to be proxied, proxy.cfc, in any directory off the webroot, for example, c:\temp\test\proxy.cfc.

               

              The following values for the cfc attribute fail. In each case Coldfusion tells you it cannot find the cfc.

               

              (1) Define the mapping testMapping in the Administrator as follows
              logical path: /testMapping  
              directory path: c:\temp\test
              Then do <cfajaxproxy cfc="testMapping.proxy" jsclassname="proxy">  or <cfajaxproxy cfc="/testMapping.proxy" jsclassname="proxy">

               

              This fails because the value of the cfc attribute may not be a mapping.

               

              (2) The relative-path versions <cfajaxproxy cfc="..\..\..\..\..\temp.test.proxy" jsclassname="proxy">  or <cfajaxproxy cfc="..\..\..\..\..\temp\test\proxy.cfc" jsclassname="proxy"> don't work either because the path may not begin with a dot.

               

              (3)  <cfajaxproxy cfc="c:\temp\test\proxy.cfc" jsclassname="proxy">  fails, even though the documentation says the cfc attribute can be the absolute path.