• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Application.cfc

Explorer ,
Apr 24, 2007 Apr 24, 2007

Copy link to clipboard

Copied

Below is a section of my application.cfc.
The page loads ok but when I make changes to
the applcication variables (e.g Application.var1="var1Name"; ) no changes take place when the page reloads on the browser.

I have to restart the ColdFusion service for this changes to be implementated. For example if I cahnge the value of Application.var1 to "three". I will need to restart the service for this to be implemented.
Any ides ?

<cfcomponent>
<cfset This.applicationimeout = createTimeSpan(0,0,20,0)>
<cfset This.clientmanagement= "yes">
<cfset This.loginstorage = "session">
<cfset This.Sessionmanagement = "yes">
<cfset This.Sessiontimeout = createTimeSpan(0,0,20,0)>
<cfset This.SetClientCookies = "yes">
<cfset This.SetDomainCookies = "no">
<cfset This.ScriptProtect = "all">
<cfset This.SiteMaintenance="false">
<cfset This.thePath = " http://localhost/resume/">


<cffunction name="onApplicationStart">
<cfscript>
//set your app vars for the application
Application.var1="var1Name";
Application.var2 = "var2Name";
Application.var3="var3Name";

</cfscript>
<cftry>
</cffunction>
</cfcomponent>
TOPICS
Advanced techniques

Views

222

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
LEGEND ,
Apr 24, 2007 Apr 24, 2007

Copy link to clipboard

Copied

Any ideas?

Yup. It is working exactly like it is supposed to. Reloading the page
in the browser is not a new application start. An application start, by
definition, only happens once after any previous application has timed
out or been stopped, such as stopping the ColdFusion service.

Two ideas to consider. If you are resetting variables, should they be
application variables. Maybe you are really dealing with data that
should be session variables.

Second, most of us write some kind of refresh trigger into our apps.
What I usually do is in onRequestStart of code something like this.

<cfif structKeyExists(ur,"refresh")>
<cfscript>
onApplicationStart();
</cfscript>
</cfif>

This will call the onApplicationStart function if the request contains a
refesh variable.

Votes

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
Explorer ,
Apr 24, 2007 Apr 24, 2007

Copy link to clipboard

Copied

Thank you.

Votes

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
Participant ,
May 28, 2007 May 28, 2007

Copy link to clipboard

Copied

LATEST
Sorry, can't delete post.

Votes

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
Resources
Documentation