The issue is this. I am working with an existing site and it is very large. They set a dozen variables in application.cfm
<cfset dbs = 'mydb'>, <cfset sitename = 'mysite'>, etc. These site wide variables are called hundreds of times through the site as #dbs# and #sitename#.
When I change to application.cfc these varables will no longer be available. I am looking for a way to make them available without replacing every #dbs# with a #application.dbs#. Any suggestions Ian?
Ah you need to set local "variable" scope variables. In an Applicaiton.cfc file you can only do that in the OnRequestStart and|or OnRequst functions.
My first guess would be an OnRequest function that may look a bit like this.
<cffunction name="onRequest">
<cfargument name="targetPage" type="String" required=true/>
<cfset dbs = 'mydb'>
<cfset sitename = 'mysite'>
<cfinclude template="#Arguments.targetPage#">
</cffunction>
Note the <cfinclude...> line. That is requred to get the actual content of the request file. I would sugest you read up on the onRequst method. It has some well know gotcha's when one starts trying to use AJAX, web services or Flash Remoting requests