Can't get this.mappings to work
Okay, I'm stumped enough to break a laptop. I've been reading every post I can find today on how to setup per-Application mappings, and it just doesn't work. Here's my situation:
I have an existing site running on Linux under CF 9.0.1, and I had Mappings configured in CF Admin for 2 directories that I use in cfinclude tags throughout my CFMs and CFCs (so that those directories can remain above the webroot and not be exposed by Apache). All that worked fine forever.
Now I need to set up a second site with a separate set of directories, but I'm starting with a copy of the existing site's folders and then modifying the paths as needed. For example, my first site is in /web/website, and my mappings are for "/cf-include" and "/cfc" mapped to "/web/website/cfc" and "/web/website/cf-include" in the Admin. My webroot is "/web/website/htdocs", which is configured as my DocumentRoot in Apache. For my second site, I created a new directory "/web/stwebsite" containing copies of the same directories, and created a VirtualHost in Apache with a DocumentRoot of "/web/stwebsite/htdocs". I then added the following two mapping lines to my new Application.cfc (in that new directory), outside any of the functions :
<cfcomponent displayname="Application" output="True" hint="Handle the application.">
<cfset this.name="stapp">
<cfset this.Sessionmanagement=False>
<cfset this.ApplicationTimeout=CreateTimeSpan(1,0,0,0) />
<cfset this.setClientCookies=False>
<cfset this.mappings["/cf-include"]="/web/stwebsite/cf-include">
<cfset this.mappings["/cfc"]="/web/stwebsite/cfc">
...
I also made sure I had the Enable Per-App Settings checked in my CF Admin (it already was). However, when I try to use those mappings, I get the one from the Admin and not the Application.cfc:
<cfinclude template="/cf-include/sttest.cfm">
I verified this by changing the content of that file in the two different directories and seeing which version showed up.
So my question is, what's preventing the this.mappings settings from being used? Am I wrong in understanding that I should be able to set those in the Application.cfc for the new site (which IS being used for that site, I verified that by changing what happens in the OnApplicationStart method) and have them supercede the Admin settings? I also tried deleting the Mappings in the Admin, but that left all the cfincludes failing (saying the mapping didn't exist). What am I missing?
