Nothing big, really. However, I did spend part of the morning figuring it out. If you follow me on Twitter, you might've noticed I had to work out a weird problem with ColdBox and jQuery. What was happening was that I had a jQuery plugin working great with CF8, but as soon as I started using it on an app built around ColdBox it stopped working.

The cause of the issues was actually pretty simple. When you create variables in ColdFusion 8 and return them with returnFormat="json", unless you created them in some fancy way the converter will serialize the variable names to upper case. In ColdBox, the opposite happens. Here's an example:

A sample CFC:

view plain print about
1<cfcomponent name="myCFC" output="false">
2
3    <cffunction name="myService" access="remote" returntype="struct">
4    
5        <cfset var result = { myvariable = "test" } />
6        
7        <cfreturn result />
8    
9    </cffunction>
10
11</cfcomponent>

Nothing too complicated happening here. We simply create a structure and put a single key in it. When outputting the return value in Firebug, here's what you get depending on if you're using CF8's built-in conversion or ColdBox's renderData():

Vanilla ColdFusion 8:

view plain print about
1"MYVARIABLE":"test"

Using ColdBox and renderData():

view plain print about
1"myvariable":"test"

Considering JS is case-sensitive, this has a pretty big impact on the way we work with returned values. I honestly don't know what I prefer between both solutions, but either way is fine. As long as we can rely on the fact that it's always lower case (or upper case for vanilla CF8), that's good enough for me. Just make sure you start by checking what's in your response.