Got it. I'm using an Application.cfc that extends another CFC... so is that 
extended CFC isn't recreated every time or just Application.cfc? The 
onRequestStart is defined in the extended CFC, not in Application.cfc



--- On Fri, 7/17/09, Chris Blackwell <[email protected]> wrote:

From: Chris Blackwell <[email protected]>
Subject: [Model-Glue] Re: using cfajaxproxy?
To: [email protected]
Date: Friday, July 17, 2009, 9:27 AM

Although the application scope is persistent a new instance of the 
Application.cfc is created for each request, in a similar way that 
Application.cfm is processed for each request.  You can verify this with the 
following methods for Application.cfc

        <cffunction name="onRequest">           <cflog log="Application" 
text="message from onRequest" />
        </cffunction>           <cffunction name="onRequestStart">
                <cfif structKeyExists(url, "foo")>                      <cfset 
StructDelete(this, "onRequest") />
                        <cfset StructDelete(variables,"onRequest")/>            
</cfif> 
        </cffunction>
Chris
2009/7/17 Jim <[email protected]>

If it is a cached CFC, would the onRequestStart method be removed for good 
after it is deleted from the structure? So that when a page request came 
through normally, would it be there?


--- On Fri, 7/17/09, Chris Blackwell <[email protected]> wrote:


From: Chris Blackwell <[email protected]>
Subject: [Model-Glue] Re: using cfajaxproxy?
To: [email protected]

Date: Friday, July 17, 2009, 9:06 AM

Incase you actually need the onRequest method for "normal" page requests you 
can use the following snippet in onRequestStart

                <!--- Remove the onRequest method for remote cfc calls, 
otherwise we'll
 get a blank response --->
                <cfif listlast(arguments.targetpage, ".") is "cfc">             
        <cfset StructDelete(this, "onRequest") />

                        <cfset StructDelete(variables,"onRequest")/>            
</cfif> 

Chris
2009/7/17 Sir Rawlins <[email protected]>




Hello Jim,



Managed to solve this with the great efforts of my fat northern friend

James Allen. I've seen this issue before myself when working with web

services and it's a bitch to diagnose and I believe generally

considered to be a bug in CF.



http://jamesallen.name/index.cfm/2008/1/30/Bug-in-calling-CFCs-remotely-via-the-URL-when-using-applicationcfc





I removed my onRequest() method from my application.cfc and it's now

returning data as expected!.



Hope this helps someone else in the future.



Rob










     













      
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

For more about Model-Glue, check http://www.model-glue.com .
-~----------~----~----~----~------~----~------~--~---

Reply via email to