ColdFusion Application.cfc OnRequestStart Returns False To Kill Page Load
I just happened upon this totally by accident, but apparently, if the OnRequestStart method of your Application.cfc returns false, none of the other request-events will fire. This leaves you with a rather confusing blank page. I wonder what this is used for. I am used to the return( false ) mentality from Javascript, but I wonder how this translates to ColdFusion.
I suppose that you could have page requests that ONLY need to send IN data, such as with a Session Heart Beat or something. In this case, you could avoid the overhead of OnRequest[End] processing. What is cool though is that you can output to the response buffer from within the OnRequestStart method so you could return data as well. Hmmmm, interesting.
Any one have any thoughts on how this could be leveraged?
Reader Comments
The docs provide an example of this use; preventing access between certain maintenance hours:
http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000700.htm
It could also be used to deny access for certain IPs etc. In other words it's like a cfabort without the cfabort.
James,
Excellent link. Thanks. That makes a lot of sense.
And once again, I run into a problem and think, "Wait a minute- I saw something like this on Ben's blog..."
@Matt,
Kinky Solutions strikes again :)