How do I extend application.cfc

New Here ,
Dec 20, 2017 Dec 20, 2017

Copy link to clipboard

Copied

My current attempt at extending m application.cfc results in this message:

The folderA.subfolderB.///Application component or interface cannot extend itself.

 

 

I have a folder named "folderA" and within this folder is an application.cfc and a subfolder named "subfolderB'  Within subfolderB I also have an application.cfc

The code within folderA/application.cfc is as follows:

<cfcomponent>
    <cfset this.name               = "test1">
    <cfset this.sessionManagement  = "true">
    <cfset this.clientManagement   = "false">
    <cfset this.setClientCookies   = "true">
    <cfset this.applicationTimeout = CreateTimeSpan(2,0,0,0)>
    <cfset this.sessionTimeout     = CreateTimeSpan(0,0,20,0)>
</cfcomponent>

The code within folderA/subfolderB/application.cfc is as follows:

<cfcomponent extends="../Application">
    <cfset this.name               = "test1">
    <cfset this.sessionManagement  = "true">
    <cfset this.clientManagement   = "false">
    <cfset this.setClientCookies   = "true">
    <cfset this.applicationTimeout = CreateTimeSpan(2,0,0,0)>
    <cfset this.sessionTimeout     = CreateTimeSpan(0,0,20,0)>
</cfcomponent>

 

What value do I need in the 'extends' in order to have the subfolderB application.cfc extend the application.cfc located in the parent folder?  Can it be a relative path?  Does it have to be a mapping to the parent folder?

 

Thanks,

Randy

Views

702

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Dec 20, 2017 Dec 20, 2017

Copy link to clipboard

Copied

LATEST

This is not a new problem. There are posts from 2006 and earlier that address this with an alternative solution:

Extending the root Application.cfc - Dan's Shorts

Extending Your Root Application.cfc — An Architect's View

I will say that sometimes things like that (which did not work in the past) may have solutions which also didn't also work then but may in later versions. Also, they may have been trying to solve a specific problem different than your own.

So first, I assume you confirmed that "..\" made no difference, right?

Second, to be clear, is "foldera" WITHIN the root of your web site, or IS IT the root of your website? If the latter, what about extends-"\Application.cfc"? That would reach that one as found IN the root of the site. Or if folderA is one down within the root, how about extends "\folderA\Application.cfc"? (And if those fail, try the different slash, /.)


/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines