Blog

Brad Wood

September 05, 2012

Spread the word


Share your thoughts

 

ColdBox handlers all support these simple AOP-style methods that require no configuration to get running:
 
  • preHandler Executes before any requested action (In the same handler CFC)
  • pre{Action} Executes before the {action} requested ONLY
  • postHandler Executes after any requested action (In the same handler CFC)
  • post{Action} Executes after the {action} requested ONLY
  • aroundHandler Executes around any request action (In the same handler CFC)
  • around{Action} Executes around the {action} requested ONLY
 
You don't have to do anything other than define these methods and the ColdBox framework will call them for you.  They supply you with a handy method of implementing security, error handling, logging, or whatever else you can dream up to your handlers; even cross-cutting several methods at once!
 
For more info and some example code, look here: http://wiki.coldbox.org/wiki/EventHandlers.cfm#AOP_Simple_Interceptors
 
P.S. {Action} would be the name of the action being run.  For instance, if your handler had a method (action) called "list", the convention would be "preList", "postList", or "aroundList".

Add Your Comment

Recent Entries

BoxLang 1.0.0 RC2 Launched

BoxLang 1.0.0 RC2 Launched

We’re entering the final stretch of our pre-releases, and we couldn’t be more excited to introduce RC2! 🚀 This release marks a major leap in performance and compatibility, the result of over six months of intensive development. Beyond enhanced stability and seamless integration, RC2 delivers game-changing performance optimizations that push the boundaries of efficiency. Get ready for our fastest, most refined release yet!

Luis Majano
Luis Majano
March 14, 2025
Ortus Monthly Recap - Jan/Feb

Ortus Monthly Recap - Jan/Feb

Ortus Solutions is kicking off 2025 with major milestones, from the highly anticipated Into the Box 2025 to groundbreaking advancements in BoxLang and key industry event appearances at Jfokus and DevNexus 2025. With new product releases, enhanced compatibility, and exclusive discounts, we’re equipping developers with the tools they need to build faster, smarter, and more efficiently.Let’s dive into the latest updates shaping the future of modern web development!

Maria Jose Herrera
Maria Jose Herrera
March 07, 2025
Building a Web App with BoxLang!

Building a Web App with BoxLang!

BoxLang, the new JVM-based scripting language from Ortus Solutions, is gaining traction among developers looking for a modern, lightweight alternative for building web applications. In a Recent blog post, Raymond Camden took it for a spin by developing a simple blog application, highlighting BoxLang's capabilities and ease of use. Let’s break down his experience and key takeaways.

Maria Jose Herrera
Maria Jose Herrera
March 04, 2025