Using onMissingTemplate

The new method that we’ll be adding to our Application.cfc file is the onMissingTemplate function. This method is passed one argument: the name of the script that was requested. Listing 19.13 shows the latest version of the Application.cfc file. Be sure to save this file as Application.cfc, not Application7.cfc.

Listing 19.13. Application7.cfc—Working with onMissingTemplate
<!--- Filename: Application.cfc (The "Application Component") Created by: Raymond Camden (ray@camdenfamily.com) Purpose: Sets "constant" variables and includes consistent header ---> <cfcomponent output="false"> <cfset THIS.name = "ows19"> <cferror type="Request" template="ErrorRequest.cfm" mailto="webmaster@orangewhipstudios.com"> <cferror type="Exception" ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.