Question
Scope variables in application in Application.cfc
Good morning everyone.
I have a question regarding the lifetime of application-scoped variables.
I am migrating to Application.cfc and in my application global variables have been set (in old application.cfm)
The global variables I set in the onApplicationStart method
Example:
<cfset application.ds = 'myDatabase'>
<cfset application.table1 = 'table.table1>
That is, database table name and database name.
But I found problems with these variables
<cfset application.URL_ARQCLI = "http: //" & # Server_Name # & ":" & # server_port # & "/ aseng / attachment / counterclient /">
Our system has the local network access url and the remote access url.
When we enter the remote access url the images are not found.
Because the variable was set in onApplicationStart, why didn't you save the reference server_name: server_port?
In my .cfm file I look for the image with the tag <image src='# application.application.URL_ARQCLI ## myImage #>
To work around the problem I set the application.URL_ARQCLI variable in the onRequestStart method and it worked.
I would like to ask a question, Application.cfm was loaded on all requests so had no problem with the variables. As server_name is set right on onApplicationStart, because images do not appear when Remote url access.
1 - local path = system.local.aseng
2 - remote path
remote.aseng: 80
Thanks.
