I’m looking for a method such as event.getCurrentPackageHandler() that would return…


…for the request…


I know I could trim the event off of the end of event.getCurrentEvent() but would prefer an in-built function if there is one that I can’t find!


you can create a request context decorator and put the method there.

Humm, that’s an interesting idea!

The wiki website is down for me right now so from memory I’ve added coldbox.requestContextDecorator=“model.requestContextDecorator” to my Coldbox.cfc and then created this…

component extends=“coldbox.system.web.context.requestContextDecorator” {
public string function getCurrentPackageHandler(required string currentEvent) {

return listDeleteAt(arguments.currentEvent, listLen(arguments.currentEvent, ‘.’), ‘.’) ;

…and then tried to use this in my handler…

prc.strAddLink = “#getCurrentPackageHandler(event.getCurrentEvent())#.add”;

…but get…

No matching Method/Function for GETCURRENTPACKAGEHANDLER(string)

I guess I’m referencing it wrongly?


try reinit’ing the app.

also, you dont have to pass in the currentEvent. in your method, you could just call getCurrentEvent().

the request context decorator decorates your event object.

arguments.event.getCurrentPackageHandler(); is how you would reference it.