Take the 2-minute tour ×

I have a test application structured like so:

  • Application.cfc
  • ApplicationProxy.cfc
  • index.cfm
  • sub_app/
    • Application.cfc
    • index.cfm

and I want my sub app to inherit all variables and events from the top level Application.cfc.

I have read and implemented Sean Corfield's ApplicationProxy method for extending an Application component but I can't get it to work as when I visit sub_app/index.cfm I get this error:

Could not find the ColdFusion Component or Interface ApplicationProxy.

From the error I can only guess that the application is looking in the wrong place, how do I correct this?


<cfcomponent name="Application" output="true">

<cfset THIS.name = "testAppA">
<cfset THIS.sessionManagement="Yes">
<cfset THIS.applicationTimeout = createTimeSpan(0,0,10,0)>
<cfset THIS.sessionTimeout = createtimespan(0,0,10,0)>
<cfset THIS.clientManagement = true>
<cfset THIS.clientStorage = "cookie">
<cfset THIS.loginStorage = "cookie">
<cfset THIS.setDomainCookies = false>
<cfset THIS.setClientCookies = true>
<cfset THIS.scriptProtect = true>
<cfset THIS.secureJSON = true> 

<cffunction name="onApplicationStart" returntype="void">

    <cfset APPLICATION.name = "testAppA">
    <cfset APPLICATION.test = "test var">



    <cfset SESSION.loggedIn = 1>




<cfcomponent name="ApplicationProxy" extends="Application">


<a href="sub_app/index.cfm">Sub app</a>


<cfcomponent extends="ApplicationProxy" output="true">


            Uses parent Application settings




<a href="../index.cfm">Parent app</a>

<cfdump var="#Application#">
share|improve this question
Perhaps this other answer will help explain it: Extending application.cfc in a subdirectory –  Miguel-F Jun 19 '13 at 12:51
add comment

1 Answer

Best way to do is create ApplicationProxy.cfc file with all function you need to inherit and then extends in Application.cfc wherever needed. I am using this method since long time and no issue face with this approach.

share|improve this answer
add comment

Your Answer


