Discovering the Java type of a CF variable...

Posted by Dan on Apr 29, 2004 @ 11:56 PM

Sean Corfield posted a cool tip on his blog yesterday on how to find out the underlying Java type of any ColdFusion variable. The article covers the fact that the "form" scope is not really struct, even though it acts like one. To find out the Java type of a ColdFusion variable, simply invoke the following methods on the variable: ".getClass().getName()". For example, to see that the ColdFusion "form" scope is indeed not a structure, try the following code:

<cfoutput>#form.getClass().getName()#</cfoutput>

Thanks to Sean for the great tip!

Categories: HTML/ColdFusion

Add Comment

Leave this field empty