0

Railo, Structures, Keys and Case

ColdFusion

After 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
number 3
thisonesecond
number 2
thisonefirst
number 1

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.

 

 

tags:
ColdFusion
Michael Sharman said:
 
Wow Dave that's great news, what version of Railo did you use?

So basically no problems with the CFML/cfscript?

How was Tomcat to install? Not too tricky?

 
posted 218 days ago
Add Comment Reply to: this comment OR this thread
 
 
No, no problems at all other than the two that I mentioned, and I think it is fair to say that this is a pretty advanced application by most people's standards. We have been using Railo 2 since we started the rewrite just before Railo 2 came out of beta status. We have been nothing but constantly and pleasantly surprised throughout this process, both in the fact of how feature complete and compatible it is, and with its remarkable speed and light footprint on the system. As for hooking it into Tomcat, there was certainly a bit of a learning hump there as that was pretty foreign territory to us as we started out this process, but now we have gotten to the point where we can just about set it up from scratch on a blank system with our eyes closed.

I should mention that Tomcat is not a requirement (Railo ships with Resin as the default app server), but rather is just the approach we took, so that we could make use of Apache webserver, and only hand off the requests that we wish to Tomcat/Railo. This allows us to use things such as mod_rewrite as well.

I have a feeling we are going to have a hard time shutting up about it once we get our heads out of the code and get it on a public server, so I am sure you will hear more soon. :)
 
posted 218 days ago
Add Comment Reply to: this comment OR this thread
 
Rob Wilkerson said:
 
Congratulations, guys. As you well know, I'm jonesing to start using v2.0...
 
posted 217 days ago
Add Comment Reply to: this comment OR this thread
 
Gert Franz said:
 
Hi Dave,

good job. We are aware of this problem and we will fix it in one of the next releases.
We will allow configuration of case sensitivity of structs in the webadmin somewhen in the future.
By default Railo will act like CFMX. We are working on the access to the different scopes in order to improve performance even more. I will blog about that as soon as we are done. Just check our blog from time to time.

Thanks for the good work.

Merry XMas and a good next year from Switzerland.

Gert Franz
Railo Technologies GmbH
gert.franz@railo.ch
www.railo.ch

Join our Mailing List / Treten Sie unserer Mailingliste bei:
deutsch: http://de.groups.yahoo.com/group/railo/
english: http://groups.yahoo.com/group/railo_talk/

 
posted 217 days ago
Add Comment Reply to: this comment OR this thread
 

Search

Dave at work...