Railo, Structures, Keys and Case
ColdFusionAfter hundreds and hundreds of development hours, Aaron and I are on the verge of releasing the completely rewritten InstantSpot to beta this week. I plan on a more detailed post of the technology later, but in a nutshell, we are releasing it as a Linux/Apache2.2.x/Tomcat/Railo2/Mach-II application.
Until today, we have found only one place that we have had to make a Railo workaround and that was using some pretty fringe functionality doing XMLRPC for desktop blogging.
Last night I ran into the second point where we have to make a workaround, although from an architecture standpoint, again it is pretty slight. This time, it came about as I was changing our Mach-II config to use the ColdspringProperty rather than the ColdspringPlugin. When I did, the application died a horrible death with errors stating that it couldn't find our imported ColdSpring XML files that are defined in our main ColdSpring XML.
After tearing into it this bit, I found that the DefaultXMLBeanFactory.cfc calls a recursive method to build a structure of the main config XML, with additional keys for each imported XML file which are the full physical path to the file itself. I could see that just prior to adding to the structure, the case was correct. However, when I look at the key that was created, it was converted to lower case.
Later in the process as the Mach-II ColdspringProperty.cfc tries to loop through these keys, the config files cannot be found if there are any capital letters that exist in the real path.
I then tried modifying the ColdSpring code to use structure bracket notation for adding the key, rather than using StructInsert(), since this is one known way of preserving key case in ColdFusion. However, I found that no matter what I did, the structure key that is created is all lowercase.
Stepping back a bit, I decided to do a simple test which confirmed this functionality:
code:
Here were the results:
Struct |
|||
| thisonelast |
|
||
| thisonesecond |
|
||
| thisonefirst |
|
||
As you can see, no matter which approach I took, the key is lowercase.
So, what does this mean for our release? Not much... back to using the ColdspringPlugin. However, it is something that I hope the fine developers of the Railo project keep in mind as a future fix.






Loading....