Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started
by Ben Forta, Raymond Camden, Charlie Arehart
Using onRequest()
So far we have seen examples of how you can run code before and after a page request, as well as during the startup and end of the application. Another way to modify the behavior of your pages is with the onRequest method. This method is executed after the onRequestStart method, and before the onRequestEnd method. It takes one argument, the template currently being executed. If you don’t actually include the template, using <cfinclude>, then your page won’t show up.
Using this method has some serious drawbacks. The mere existence of this method won’t allow any Flash Remoting or Web Services calls. The method also tends to “leak” variables into the template itself. If all of this sounds confusing, don’t worry. Typically you ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access