ColdFusion onRequest method & site-wide error handler quirk
By Aaron Foote at 9:44 in: ColdFusion | DevelopmentOne of our clients uses a site-wide error handler to catch errors and perform cleanup of com and Java objects. Recently an onRequest handler was added to the Application.cfc file and we found that the cleanup was no longer being performed.
The cleanup code referenced objects in the local / unnamed scope. Without an onRequest handler we had access to this scope & all object created on any page on the site that threw an error. The onRequest changed things, so we no longer had access to these objects in the unnamed scope (we still have an unnamed scope, but it’s empty).
The solution was to store these objects in the request scope, which the site-wide error handler does have access too.
- Permalink
- Bookmark: Digg This! | Del.icio.us | Technorati










i’ve had that same problem, annoying huh?