Last updated:

Get Your Site Submitted for Free in the World's Largest B2B Directory!

Email Address:
* URL:
*
*Indicates Mandatory Field

Terms & Conditions

DevWebProBR
FlashNewz
DevWebPro





ColdFusion Mapping Names & Conflicts

By Raymond Camden
Expert Author
Article Date: 2007-09-10

This weekend a reader asked me an interesting question about ColdFusion mappings.

Imagine the following two mappings:
* Mapping /org points to /Webserver/Webroot

* Mapping /org/foo points to /projects/foo.com
He was curious to know if this would work right. The second mapping looks to be under org, but really points to a completely different path. I didn't know the answer to this. Every single mapping I've used in the past has always had a simple name, like /org or /foo.

I whipped up a quick test with two mappings named like the examples above. I put the same named CFC in each, but with different methods. I then wrote a quick script:

<cfset test = createObject("component","a.test")>

<cfdump var="#test#">

<cfset test = createObject("component","a.b.test")>

<cfdump var="#test#">


The results showed that there was no problem having mappings with similar names in completely different folders. ColdFusion treats the mapping name as just a simple string.

The fact that one was a and one was a/b didn't imply anything special to the server.

The problem - though - would be that if someone put a physical folder named "b" under the folder that my "a" mapping pointed to - there would be a conflict.

Which would win? The mapping.

I would definitely recommend having mapping names that did not match up like the examples aboe.

Comments


About the Author:
Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com

Raymond Camden is Vice President of Technology for roundpeg, Inc. A long time ColdFusion user, Raymond has worked on numerous ColdFusion books and is the creator of many of the most popular ColdFusion community web sites. He is an Adobe Community Expert, user group manager, and the proud father of three little bundles of joy.


Newsletter Archive | Article Archive | Submit Article | Advertising Information | About Us | Contact

DevWebProBrazil is an iEntry.com publication
© iEntry Inc. All Rights Reserved Privacy Policy Legal

Click Here to Return to the Home Page