I feel like I am going crazy! I setup an Application.cfc
with something super simple like this:
component {
this.name = "mappings";
this.applicationTimeout = createTimeSpan( 0, 0, 0, 10 );
this.sessionManagement = false;
this.webrootDir = getDirectoryFromPath( getCurrentTemplatePath() );
this.mappings = {
"/": this.webrootDir,
"/here": "#this.webrootDir#some/thing/over/here/"
};
}
Then, in my index.cfm
file, I am just trying to see if the mappings
are working:
<cfscript>
dump( expandPath( "/here/data.json" ) );
</cfscript>
If this is the first time I run the application, this will work and expandPath()
will return the right path. However, if I then go back into my Application.cfc
and add a new mapping:
this.mappings = {
"/": this.webrootDir,
"/here": "#this.webrootDir#some/thing/over/here/",
"/there": "#this.webrootDir#some/thing/over/there/"
};
… and update the index.cfm
file to use /there
:
<cfscript>
dump( expandPath( "/there/data.json" ) );
</cfscript>
… It sees the file in the root of the Application. To be clear, I have the Server and Web contexts setup to always look for changes. Literally nothing I do will add the path. Not even restarting the Lucee (CommandBox) server. The only thing that works is renaming the directory that my code is in. At that point, the new path mapping seems to be picked up.
I’ve been trying different things for the last 2-hours and I cannot for the life of me figure out what is going on. I even tried the “update application settings” technique using getApplicationSettings()
and could not get that to work either.
I’m on Lucee 5.3.3.62 using CommandBox on my Mac OS. Is there something about application settings caching that I am not finding in the docs?