Fun way to break attributeCollection in ColdFusion 8

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

<cfset s = {url="http://cnn.com", result="result"}> <cfhttp attributeCollection="#s#">

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

<cfset s = {url="http://cnn.com", result="result"}>

<cfset s.attributeCollection=structNew()> <cfhttp attributeCollection=”#s#”> </code>

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. 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 https://www.raymondcamden.com

Comments