ColdFusion - what is the mechanism behind this component resolution?

Viewed 73

I have a collection of pages, physically rooted at, say, root, with plenty of sub-directories representing applications. Looks like this:

root
 |----a
 |    |-AppA1
 |    |-AppA2
 |
 |----b
      |-AppB2
      |...

I have an IIS server setup to serve root as a virtual directory under the name not_root. I say "not_root" because it can be named anything, so long as it points to root.

My question starts here: I have no mappings at all in my CF setup, but I am able to resolve CFCs stored anywhere in this hierarchy from anywhere in this hierarchy, like so:

new not_root.a.AppA1.someCFC();.

Which I do not fully understand; it appears CF is communicating with IIS about the physical path of the site root, or CF takes the URL into consideration when resolving a CFC?

I am not complaining about this, it is helpful. But I am wondering if someone can point me to a doc or explain how this is working, and if this is expected behavior and can therefore be relied on.

1 Answers

Since you have no mappings set it is going to use the webroot relative path, which seems to be what you are describing. The answer to this question might be helpful to understand what is going on:

Mapping to a CFC in ColdFusion

Or here they refer to it as qualified path:

http://dulaw.org/cfdocs/htmldocs/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7e17.html

How you are referencing your CFC's is how we usually did it. The typical settings in the environment did not have any mappings set. A difference was each of our applications had it's own IIS Site with exception of the Dev environments where it was just one IIS Site then apps off that in their own sub-directories. So the Dev environment it certainly been possible for someone to reference a CFC over in AppA1 from AppA2 but it was not something that actually happened.

Related