Fun way to break attributeCollection in ColdFusion 8

This post is more than 2 years old.

Ok, so I love the new attributeCollection feature of ColdFusion 8. Here is a simple example:

<cfset s = {url="", result="result"}> <cfhttp attributeCollection="#s#">

But for the heck of it, I tried something a bit crazy:

<cfset s = {url="", result="result"}>

<cfset s.attributeCollection=structNew()> <cfhttp attributeCollection="#s#">

I wasn't sure what it would do. My guess is that it would apply attributeCollection as an attribute and complain that it wasn't valid. Or I thought maybe it work recursively. Well, not sure if "recursive" is right - but I thought it would apply the top level struct as attributes, then reapply the empty attributeCollection struct.

Nope - it just throws a JRun Servlet Error. So a total waste of time - but I thought I'd share.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate for HERE Technologies. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA