Issues with CFML Syntax when Switching from Adobe ColdFusion to Railo

Railo is an open source CFML server that can replace Adobe (or Macromedia) ColdFusion. I ported several CFML-based apps from an old instance of Macromedia ColdFusion MX 6 to Railo 3.2.1 about two years ago, and it’s been relatively trouble-free since the change.

However, the change itself was fraught with difficulties. That was due, not to problems with Railo, but to the forgiving nature of ColdFusion (CF). If the CFML wasn’t written exactly right, CF would parse it fine, but Railo wouldn’t take it. An example of this is the following code:

Before:

	<option value="A" < cfif #Sec_Level# eq 'A'>selected
		</cfif>>Administrator
		<option value="D" <cfif #Sec_Level# eq 'D'>selected
		</cfif>>Data Entry/General User

After:

	<option value="A" <cfif #Sec_Level# eq 'A'>selected="selected"</cfif>>Administrator</option>
	<option value="D" <cfif #Sec_Level# eq 'D'>selected="selected"</cfif>>Data Entry/General User</option>

The “Before” code gave the error: “no matching start tag for end tag [cfif]”.

The key change that was required wasn’t the closing option tag or the change to the selected attribute; that was just good form. It was the space between the “<” and the “cfif” in the opening cfif statements that caused the error. Simply removing that space fixed the problem.

Seemingly small problems like this will cause Railo (at least version 3.2.1) to throw errors. If the code is written properly to begin with, this will likely not happen.

Houston, TX 77002

4 Replies to “Issues with CFML Syntax when Switching from Adobe ColdFusion to Railo”

    1. I’m not sure I understand your question; the issue is that Railo (at least the older versions – can’t speak for >3.2.1) is not as forgiving as CF is with CFML tags. I had several CFML apps and had to alter some of the tags that were mistyped to make the site render properly. Regular HTML and XML would be rendered by IIS anyway, so no changes were necessary there.

      1. Hah! Ironically by adding the < a > tag in my comment it actually made a link.

        I agree with you, Railo is stricter but I seriously regard the ability to add a space between the < and “cftag” a bug . (security implications abound too)

Leave a Reply