It’s a common practice to cfinclude your page template file from the application.cfc onRequest() method like so:
public void function onRequest (
required string targetPage) {
include Arguments.targetPage;
} // onRequest()
But, Arguments.targetPage will see all the methods and variables that are defined in application.cfc, including the “this” scope. Is there another way to do this so that Arguments.targetPage does not see anything defined in application.cfc?
The code that I want processed before the template goes in onRequestStart() and the code that I want processed after the template goes in onRequestEnd().