Update: there is a way to extend the root Application.cfc without using a mapping. In your root directory, alongside your root Application.cfc, create ProxyApplication.cfc that contains just these two lines:
<cfcomponent extends="Application">
</cfcomponent>
Now, in your subdirectory's Application.cfc you simply extend ProxyApplication (which CFMX will find in your root directory). It doesn't need mappings so it should help people on shared hosts, as well as keeping your server configuration leaner.</cfcomponent>

8 responses so far ↓
1 PaulC // Apr 29, 2005 at 9:52 AM
2 Sean Corfield // Apr 29, 2005 at 4:06 PM
3 nobody // Oct 20, 2006 at 8:08 AM
4 Sean Corfield // Oct 20, 2006 at 8:58 AM
5 Chris // Dec 26, 2008 at 12:05 PM
c:/inetpub/wwwroot/domainname/Application.cfc
c:/inetpub/wwwroot/domainname/ApplicationProxy.cfc
c:/inetpub/wwwroot/domainname/admin/Application.cfc
The root level app.cfc runs just fine for the root level. The ApplicationProxy.cfc contains the following:
<code><cfcomponent name="ApplicationProxy" extends="Application">
</cfcomponent></code
The admin/Application.cfc starts off with <code><cfcomponent name="Application" output="false" extends="ApplicationProxy"></code>
When I run any page in the admin folder I get the following: "Could not find the ColdFusion Component or Interface ApplicationProxy."
I was entrenched in my app.cfm for so long and didn't want to make the jump b/c most of my apps have multiple levels of access just like this and I always came up lacking in the sub directories - but I just have to do it....
Also I am not sure if it matters but my root level app.cfc does contain the onrequest method and a way to remove it should the caller be a cfc.
<code> <cfif listlast(arguments.thePage,".") is "cfc">
<cfset StructDelete(this, "onRequest") />
<cfset StructDelete(variables,"onRequest")/>
</cfif></code>
Jsut hoping you can help shed seom light on it for me.
Thanks much!
Chris
6 Sean Corfield // Dec 26, 2008 at 12:23 PM
After nearly four years, I don't remember what setup I used to make that work (but I'm sure it was a default install - CF *used* to have a / mapping by default but it went away at some point).
7 Chris // Dec 26, 2008 at 12:42 PM
But If I do exactly the same thing - it doesn't work. I know it must be something in my code - but any idea why no one seems to promote using that method in extending their app.cfc? Everywhere I look all I see is "extend it using the proxy.cfc method" But it seems like it is not really reliable. Just babbling now. Thanks for the response.
Chris
8 Gary Fenton // Aug 8, 2009 at 6:02 PM
Chris, I couldn't get Sean's proxy method to work either after hours of head banging, but it did work using your simple idea of extends="RootAppName.Application" which I came across as I was about to give up. Maybe because Sean's method only works with CF6 since we're going back to 2005.
The Adobe CF docs don't explain how "extends" works particularly well. Glad it's sorted now. Luckily people don't shy away from commenting years after a blog entry is published. :-)
Leave a Comment