Posted in ColdFusion | Posted on 11-05-2007 | 6,790 views
Someone asked me today when I was going to update my Application.cfc reference (linked to in the Guides pod to the left) for ColdFusion 8. I went ahead and did so. You can see the new guide here:
http://www.coldfusionjedi.com/downloads/application.cfc.txt
You will notice I changed to a text file for this one. I always found it bothersome that when I copied from the PDF, I lost my tabs. Since I'm a bit anal retentive about tabbing, I figured a simple txt file would be better. Shoot, this whole PDF thing is probably just a fad anyway.
I also included comments in this template. I didn't do it before because - well - I wanted folks to have something they could just cut and paste into a new file (or into a CFEclipse Snippet). But I figured one line comments can't hurt. If folks think it is a mistake, let me know. Again the intent here is to serve as a template, not really a learning guide. You will notice that in the official docs, they forgot some of the items you can include. For example, the reference guide forgot customtagpaths and mappings. The dev guide has them - but forgot the other new This scope items like secureJSON. (I've logged bugs for both of these issues.)
Lastly - I've kept the CF7 version linked as well.


:)
Thanks Ray...the tutes and assistance you give are always top notch. Appreciated.
Thanks!
<cfset StructDelete( THIS, "OnRequest" ) />
<cfset StructDelete(variables,"onRequest")/>
</cfif>
otherwise my cfselect binding to a cfc in the same directory doesn't work.
Hmmmm. What do people think? What if I add an additional comment with very obvious warnings:
<!--- NOTE THAT THIS METHOD DISABLES CFC CALLS --->
And maybe I can link to an a blog entry on the method you described?
BUT!
Today I was working on some Ajax calls direct to a CFC and they were returning a blank page. I could not figure out why for 2 hours until I found this page.
As soon as I put in Brian's code, it started working as expected. (THANK YOU BRIAN!)
What the F is up with having to do that?? Why does your template not work with direct calls to CFCs? I'm an advanced CF developer and you've got me on this one.
Anyway, it's not "very obvious" to me, sorry. I wish you would have put that comment in, as well as some kind of explanation WHY it disables CFC calls and HOW to enable them.
Thanks very much for all you do!!
Justin
It consumes the url vars as both url and argument input. I just output from onRequestStart and the called function to screen to test:
SIMPLE FUNCTION:
ffunction name="fn_TestGateway" access="remote" returntype="any" hint="TEST" >
<cfargument name='testytester'>
<HR/>fn_TestGateway HAS RUN CORRECTLY...<HR/>
<cfif isDefined('arguments.testytester')>ARGUMENT: <cfoutput>#arguments.testytester#</cfoutput><br /></cfif>
<cfif isDefined('url.testytester')>URL: <cfoutput>#URL.testytester#</cfoutput><br /></cfif>
</cffunction>
REQUEST:
http://mfi/_code/_application/_initializeApplicati...
RESULT:
- in onRequestStart - x=123
fn_TestGateway HAS RUN CORRECTLY... ARGUMENT: howdy
URL: howdy
I must be going blind but I can't find the link to the MX7 version of your template, could you post a link?
Thanks...
Phil
On a side note, I've downloaded BlogCFC and found a couple of issues, where would be the best place to report them? Excellent application overall though...
Phil
http://blogcfc.riaforge.org
[Add Comment] [Subscribe to Comments]