Showing posts from April, 2009

ColdFusion All Scopes Local Variables using Java getPageContext() Method


You might have heard about CF's undocumented features. One of them came in really handy for me. Its the getPageContext() Method. Using this method, we can list all variable scopes. You could do something like this

<cfdump var="#getPageContext().getVariableScope()#"> or
<cfdump var="#getPageContext().getBuiltInScopes().Variables#">

to get local variables scope and similarly for other variable scope. I read about this method at 2 great blogs, one by Ben Nadel and other by Mark Kruger.

Hope this helps.