WebDevelopment, ColdFusion, Railo, JS, Database and Tech-related by the Co-Founder and CEO of tunesBag.com

Wednesday, 29 April 2009

Railo - Compatibility issues with scopes (URL etc)

I'm migrating my development environment to railo and found some issues that affected my code.

One of the most important ones is that railo always references the scope name when you use URL, FORM etc no matter if a local variable with this name exists or not. To give you an example, run this code in CF and in railo:

<cfparam name="url.step" type="string" default="1" />

<cfset a_call = PrintURL( 'http://tunesBag.com/' ) />

<cfdump var="#a_call#">

<cfscript>
function PrintURL( url ) {
return url;
}
</cfscript>
To make railo behave the same way, you've to add a full reference to the function -
return arguments.url

In ColdFusion you'll see http://tunesBag.com as output, in railo the URL structure. Some further explanations concerning the scopes and this "bug" can be found here (Adobe Livedocs) and here (Railo Bugtracker)

No comments: