User Guide
954 Chapter 5: Application.CFC Reference
• Code in this method that precedes the call to the target page can perform the same functions as
the
onRequestStart method, and shares the Variables scope with the target page.
• Code in this method that follows the call to the target page can perform the same functions as
the
onRequestEnd method, and shares the Variables scope with the target page.
• If you implement this method, you can also implement the onRequestStart and
onRequestEnd methods.
You can use this method to do preprocessing that is required for all requests. Typical uses include
filtering and modifying request page contents (such as removing extraneous white space), or
creating a switching mechanism that determines the exact page to display based on available
parameters.
Example
<cffunction name="onRequest">
<cfargument name="targetPage" type="String" required=true/>
<cfset var content="">
<cfsavecontent variable="content">
<cfinclude template="#Arguments.targetPage#">
</cfsavecontent>
<cfoutput>
#replace(content, "report", "MyCompany Quarterly Report", "all")#
</cfoutput>
</cffunction>